Hi Mark,
Thanks for contacting Syncfusion support.
Query : Error in Code in Help Docs
Sorry for the inconvenience caused.
Based on your reported documentation link we have used closest method to get the row details from the target element. But in this we missed to define origin of closest(base) method.
So please refer to the modified code and sample.
var onClick = function(args){
var rowObj = grid.getRowObjectFromUID(new ej.base.closest(args.target, '.e-row').getAttribute('data-uid')); // base method
var data = rowObj.data;
alert(JSON.stringify(data));
}
{ headerText: 'Commands', width: 120, commands: [{ buttonOption: { content: 'Details', cssClass: 'e-flat', click: onClick } }]},
|
(Or)
By default we have an option as “commandClick event” used to get row details while clicking command column buttons. Please refer to the below code and sample link.
var grid = new ej.grids.Grid({
. . . . . .
columns: [
. . . .
{ headerText: 'Commands', width: 120, commands: [{ buttonOption: { content: 'Details', cssClass: 'e-flat' } }]},
],
commandClick : function (args){
alert(JSON.stringify(args.rowData));
},
height: 315
});
grid.appendTo('#Grid');
|
Note : We created an enhancement documentation task for this scenario and intended to refresh our upcoming release.
Please get back to us, if you need any further assistance.
Regards,
Thiyagu S.