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

Client API OnRowClick first parameters

2 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dstj
Top achievements
Rank 1
dstj asked on 09 Jan 2009, 05:58 PM
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 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Jan 2009, 02:41 PM
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.
0
dstj
Top achievements
Rank 1
answered on 12 Jan 2009, 04:07 AM
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...
Tags
Grid
Asked by
dstj
Top achievements
Rank 1
Answers by
Daniel
Telerik team
dstj
Top achievements
Rank 1
Share this question
or