ClientEvents-OnCommand does not fire ItemCommand

2 posts, 0 answers
  1. bahgat
    bahgat avatar
    2 posts
    Member since:
    Sep 2010

    Posted 08 Sep 2010 Link to this post

    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

  2. Rosen
    Admin
    Rosen avatar
    2650 posts
    Member since:
    Sep 2012

    Posted 09 Sep 2010 Link to this post

    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

Back to Top