How to get row data in kendo grid when button is clicked

Let us consider their is a edit button in kendo  grid as shown below

ex:           {
                    command: [{
                        name: "edit",
                        className: "btn-Edit",
                        text: "Edit", click: btnEdit
                    }], title: "Action", media: "(min-width: 500px)", width: "220px"
                }

Now In btnEdit() function we get the button clicked row data using jquery as shown,

ex:      function btnEdit(e) {
            var grid = $("#gridName").getKendoGrid();
            var item = grid.dataItem($(e.target).closest("tr"));
            //here item contains all row data
           }

Comments

Popular posts from this blog

Implement virtualisation in kendo drop down list using jquery ajax in mvc, aspx page

How to Create trigger to Update the NoofOrgs Count under each category in Category Table based on Temp Table in Sql Server

How to Preview the image and download which is in base64string format in mvc view using C#