In latest 2015.2 version activerowchanged event is getting called even when you click outside of grid. This is called due to focusout event which is new in 2015.2. I think activerowchanged should be called when someone is changing the active row on grid.
See attached example.
With the fix for bug #214181 that was logged for the issue you'll be able to check for ui.row being null when focus out causes the activeRowChanged. A workaround achieving the same behavior will be hard to implement but you can use the following before your grid definition:
$.ig.SelectionCollection.prototype.deactivate = function (suppress) { if (this._requestTrigger("ActivationChanging", true, null)) { this._notify("deactivate"); this.activeElement = null; this._requestTrigger("ActivationChanged", true, null); }}
This will overwrite the default behavior for activeRowChanged to be fired at all on focus out which should achieve your requirements.
I hope this helps!
Best regards,
Stamen Stoychev
I'm using Jquery UI 1.10.4 with Jquery 2.0.3. Could you please let me know the code for to distinguish both ?
Hello Manish,
I've also noticed it in my tests but it didn't happen nearly as often for me. Could you please let me know which version of jQuery, jQuery UI and on which browser you are testing?
In any case, after the fix the activeRowChanged events coming from focus outs have their row event arguments set to null which means that they are easily distinguishable. The fix will be available in the next SR, or if your development schedule requires it can be provided as an untested build.
Yes it called twice and it happens 10 out of 100 times.When i looked call stack for both of these , one was coming from mouse up event and another was coming focus out event. Whenever call some from focus out event ui.owner.activeRow() still contains last selected row.
Does activeRowChanged fire twice between user clicks then? I am not sure I understand the problem since activeRowChanged is expected to fire every time the user clicks on a row and therefore focuses/activates it.