Welcome Guest Search | Active Topics | Sign In | Register

Grid ClientSideOnItemSelected with client side sort Options
Klaus Lehtonen
Posted: Friday, August 8, 2008 2:25:07 AM
Rank: Newbie
Groups: Member

Joined: 8/8/2008
Posts: 2
Each time you sort a grid at client side it launches ClientSideOnItemSelected event even though the selected item is the same as before. You can reproduce the problem by adding the following function to a page and setting ClientSideOnItemSelected="select" to some grid that has FullRowMode set to true.

<script type="text/javascript">
function select() { alert('New selection.'); }
</script>
eo_support
Posted: Friday, August 8, 2008 6:01:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

This behavior is by design. The reason is even it is still the same item, the item's index may have been changed, thus ClientSideOnItemSelected gives user a chance to handle that.

If you do not want certain code to be called twice, you can save the last selected item in a variable, then compare that with the new selected item. If it is the same, you can ignore it.

Hope this helps.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.