Client API OnRowClick first parameters

3 posts, 0 answers
  1. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 09 Jan 2009 Link to this post

    Hi,

    In the client API online documentation here, it is said the parameters for OnRowClick are :

    gridDataItem - tablerow instance

    domEvent - dom event


    But, using Firebug, I get this that the sender is a RadGrid object, not a gridDataItem object.
    sender = Object_element=div#ctl15_rgrdMembers.RadGrid 

    Using the following function for example validates that the sender in not the row...
    function RowClick(sender, eventArgs)  
    {   
       alert(sender.get_element().getAttribute("id"));  

    When trying to access sender.get_element().attributes, I do not get the <tr> attributes but the RadGrid's <div> attributes.

    Am I missing something? Do I read the documention wrong ? I need to access a custom attribute in the <tr>. How can I do it ?

    Thanks,

    dstj.
  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 10 Jan 2009 Link to this post

    Hello Dominic,

    Let me give a short explanation:
    function RowClick(sender, eventArgs) 

    Arguments eventArgs (event arguments)

    Argument 1: gridDataItem
    eventArgs.get_gridDataItem(); 

    Argument 2: domEvent
    eventArgs.get_domEvent(); 

    Regarding your question:
    var row = eventArgs.get_domEvent().target.parentNode; 

    I hope this helps.

    Best regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dstj
    dstj avatar
    82 posts
    Member since:
    Oct 2006

    Posted 11 Jan 2009 Link to this post

    That explains it. Thanks a lot

    So, "sender" is always the RadGrid and most often than not unused?

    I did not find that subtlety in the documentation, I imagine this is a global concept for all RadControls Client API. I'll know for the next time...
Back to Top