Roberto Nicchi Posted July 29, 2021 Share Posted July 29, 2021 I have defined this JS event function spinend(sender, eOpts) { do something with sender.value } but this event (of course) is not executed if the user change the component value with keyboard instead that with mouse. I see there isn't a change event. So how to execute the code when the value is changed ? i have tryed with keyup event but it's executed also pressing the tabkey or other FN key. I don't know how to detect if the value has changed. Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 29, 2021 Share Posted July 29, 2021 1 hour ago, Roberto Nicchi said: but this event (of course) is not executed if the user change the component value with keyboard instead that with mouse. Why don't you want to use a server-side event? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 29, 2021 Author Share Posted July 29, 2021 When the spinedit is changed i have to update a grid (clear all records and recreate records). Doing this i have an exception if the grid is in edit mode (Grid is in dirty state). My solution is to call a javascript function that is defined in the grid. This function first call the completeEdit function and after execute an ajaxRequest. In the OnAjaxEvent the grid is updated. function afterCreate(sender) // this function is now executed in the spinend event of the unispinedit component { sender.refresh_records = function() { var grid = sender; if (grid.editingPlugin.editing) { grid.editingPlugin.completeEdit(); } ajaxRequest(this, '_refresh',[]); } } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 29, 2021 Share Posted July 29, 2021 1 hour ago, Roberto Nicchi said: I see there isn't a change event. UniSpinEdit -> ClientEvents -> ExtEvents -> function afterrender(sender, eOpts) { sender.on('change', function() { // change event }) } 1 Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 30, 2021 Author Share Posted July 30, 2021 14 hours ago, Sherzod said: UniSpinEdit -> ClientEvents -> ExtEvents -> function afterrender(sender, eOpts) { sender.on('change', function() { // change event }) } So the event exists but is not exposed by UNGUI. I have added in in ExtEvents (Add Custom Events button) and works perfectly. Thanks 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.