Rank: Newbie Groups: Member
Joined: 10/21/2010 Posts: 6
|
Hello,
I have a grid where I have set some columns AllowSort property to true and I also have a JavaScript function that handles the ClientSideOnItemSelected event. I am finding that when I sort the column, the ClientSideOnItemSelected event gets fired.
Is this expected behaviour? And if so, can someone recommend a way to find out if the column has been sorted vs. the record has been selected by the user?
Thanks, Kevin Parkinson
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Yes. This behavior is by design. The reason is some users need to track the current selected item index. Once it has been sorted, the selected item index will change. So we fire ClientSideOnItemSelected again to notify user that a "new item" has been selected.
There is no easy way to distinguish the two. The only difference between the two cases is if it is triggered by sort, then after ClientSideOnItemSelected is fired, ClientSideOnSort will also be fired. However ClientSideOnSort is fired AFTER ClientSideOnItemSelected is fired. So if you really need to distinguish these two cases, you will need to set a timer in ClientSideOnItemSelected, then check whether ClientSideOnSort has been "recently" fired inside that timer.
Hope this helps.
Thanks!
|