Access entire data item in client javascript

2 posts, 0 answers
  1. Michael
    Michael avatar
    66 posts
    Member since:
    Dec 2009

    Posted 28 Mar 2014 Link to this post

    I have a ajax bound grid with the following client template:

    ClientTemplate("<img onclick='grdCreateClick(#=TransactionID#,#=FormID#,#=UserID#,#=DetailID#);' />")

    Is there a way to pass the entire data item row instead of passing each field like:

    ClientTemplate("<img onclick='grdCreateClick(data);' />")

    any help is appreciated.

  2. Nikolay Rusev
    Nikolay Rusev avatar
    2289 posts

    Posted 31 Mar 2014 Link to this post

    Hello Michael,

    The click handler should look like the following:
    <img onclick='grdCreateClick(#:JSON.stringify(data)#)' />

    Nikolay Rusev

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Back to Top