This is a migrated thread and some comments may be shown as answers.

ClientEvents-OnCommand does not fire ItemCommand

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bahgat
Top achievements
Rank 1
bahgat asked on 08 Sep 2010, 03:36 PM
i have problem ClientEvents-OnCommand does not fire ItemCommand 

i use v 2010.2.908.35


this is my code

 function OnCommand(sender, args)
 {

            if (args.get_commandName() == "RebindGrid")
            {
                var tree = $find("<%=RadPanelBar2.ClientID%>").findItemByValue("the_value2").findControl("RadTreeView1");

                alert(tree.get_checkedNodes().length);
                if (tree.get_checkedNodes().length <= 0) {
                    args.set_cancel(true);
                }

        }
 }


when the commandName = "RebindGrid"  do postback  but  it does not fire itemcomamnd
         
but when the commandName =  any thing else it  do postback  and  fire itemcomamnd


and how can i get the ticket #212372.

thanks

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Sep 2010, 12:31 PM
Hi Bahgat,

This is expected behavior and it is by design. As the client-side RebindGrid command actually rebinds the RadGrid and it may be fired outside of the item's context, for example by calling rebind method or through firecommand (which is actually used behind the scene with OnCommand client-side handler), command cannot use server-side event bubbling to raise ItemCommand event as an item may not even exist.

Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
bahgat
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or