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

Top MNC Interview Questions- Full Stack Developer

Interview Questions-2

How to get the user details, user current level, next level, Rank in sql server