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.
This works fine when user select something outside the grid. But lets say I have one row selected in grid and now I select another row . Event focus out is called when i select another row and that trigger active row changed event . ui.owner.activeRow() is not null in this case.
Digging this up I see where the issue is. Unfortunately, the last activeRowChanged has incorrect event arguments (basically point to the last active row) so you can't really tell if the user clicked inside or outside the grid. I logged this as a bug in our internal tracking system with #214181. A support case is created on your behalf with number CAS-169874-W3N8T7, so that you can be notified when the bug is fixed. You can find your active cases under Account - Support Activity in our website. Select your ticket and go to Development Issues tab to view the status of related bugs.
Fortunately, you don't have to wait until the bug is fixed since there is a pretty straightforward workaround that won't add any overhead compared to simply getting the state from the event arguments. It is based on the fact Selection actually clears the active element internally before sending the event so you can differentiate between users clicking on rows and outside the grid by calling the activeRow method like this:
features: [
{
name: "Selection",
activeRowChanged: function (evt, ui) {
if (ui.owner.activeRow() !== null) {
// execute your logic here
}
]
I hope this helps! Please, let me know if you have any other questions or concerns!
Best regards,
Stamen Stoychev
Re: activerowchanged event issue
on ActiveRowChanged we call web service to load some data in accordion on screen. So soon as user open accordion to see data it calls another web service call ( call ActiveRowChanged again) which result into performance issues.
Hello Manish,
The latest versions of 15.1 and 15.2 contain a number of improvements to our WAI-ARIA support. A part of this is the ability to focus each individual row/cell so that screen readers can read its role and contents. With this in mind it didn't make much sense to leave the existing activation behavior separate so we instead tied it to the focused element. When the end-user clicks outside the grid the focus is lost and the active element is cleared, firing activeRowChanged/activeCellChanged in the process. This is the intended behavior for the latest versions of the product.
Could you please give me more information about your use-case and how this change makes it harder/impossible to implement? I could probably help you with a workaround if this is the case.