I have a KendoUI Grid with columns as below.
columns: [
{ field: "username", title: "Email Id", width: 120 },
{ field: "firstName", title: "First Name", width: 110 },
{ field: "lastName", title: "Last Name", width: 110 },
{ field: "phone", title: "Phone Number", width: 90 },
{ command: "edit", title: " ", width: 90 },
{ command: {text: getButtonText(), click: deleteUser }, title: " ", width: 90 }
]
function getButtonText(e){
alert(e);
var data = this.dataItem($(e.currentTarget).closest("tr"));
return "test";
}
function deleteUser(e){
}
The last command , the label/text of the button depends on the data. It could be different for every row. e.g. Delete , Lock, Unlock etc...
For that I have written a function getButtonText(e) above to decide the button text.
When I run this, the variable e in the function is undefined.
Please help me if you know the solution.
Thanks,
columns: [
{ field: "username", title: "Email Id", width: 120 },
{ field: "firstName", title: "First Name", width: 110 },
{ field: "lastName", title: "Last Name", width: 110 },
{ field: "phone", title: "Phone Number", width: 90 },
{ command: "edit", title: " ", width: 90 },
{ command: {text: getButtonText(), click: deleteUser }, title: " ", width: 90 }
]
function getButtonText(e){
alert(e);
var data = this.dataItem($(e.currentTarget).closest("tr"));
return "test";
}
function deleteUser(e){
}
The last command , the label/text of the button depends on the data. It could be different for every row. e.g. Delete , Lock, Unlock etc...
For that I have written a function getButtonText(e) above to decide the button text.
When I run this, the variable e in the function is undefined.
Please help me if you know the solution.
Thanks,