We have two grids in our site that have a custom command button declared similarly to this:
columns.Command(cmd => cmd.Custom("Unaudit").Click("unaudit")).Width(60);
unaudit is a javascript function. Works ok but inside unaudit we have to jump through hoops to get the data we want, the id of the record in that grid row.
var id = this.dataItem($(e.currentTarget).closest("tr")).ID;
Is there a way to access the data object and pass just a field to the javascript function?
example (not working)
columns.Command(cmd => cmd.Custom("Unaudit").Click("unaudit(data.ID)")).Width(60);
Help is appreciated. Thanks. Note that if i am required to use a client template column instead, i do know how to do that but was hoping i wouldn't have to do that.