Hi
I can add buttons to a command column in a grid and trigger click events fine. What I want to do now is add a command button to my row template
In the row template I have
And then in my document ready function I have
This works and the message appears whenever I click on one of the delete buttons, however what I want to do when the user clicks is make an ajax call that deletes the item from its ID property....
When using a command column I would do something like
i could then use dataItem.ID to reference the ID of the relevant row.
How can I do this for the button I have created above in the row template?
Many thanks
I can add buttons to a command column in a grid and trigger click events fine. What I want to do now is add a command button to my row template
In the row template I have
#if (IsMe) {# <a class="k-button k-grid-delete">Delete</a> #} #And then in my document ready function I have
$("#grid").on("click", ".k-grid-delete", function () { alert("click delete command"); });This works and the message appears whenever I click on one of the delete buttons, however what I want to do when the user clicks is make an ajax call that deletes the item from its ID property....
When using a command column I would do something like
function delete(e) { e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr"));i could then use dataItem.ID to reference the ID of the relevant row.
How can I do this for the button I have created above in the row template?
Many thanks