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

How to use youtube api's in your application.

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

Interview Questions-2