How can i get Selected Kendo Grid cell Value

Rob

I have the following code to display the selected KendoGrid Row in a form. I used this code it looks like it will take me to what i want to accomplish but I need help instead of displaying only the first cell, i also want to display the rest of values and display in the form as $("#ID").val(value);

which only displays the first <td> text but i want to

      $("#AddressGrid").on("click", "td", function (e) {
        var row = $(this).closest("tr");
        var ID= row.find("td:first").text();
          $("#ID").val(ID);// this display the selected row first cell in #ID text form but i want to access the rest of cell
        console.log(ID);
});
rabink

First of all, the line row.find("td:first") selects only first td of the row. So, you should use row.find("td") instead and iterate through all the results to access each cell of the grid. E.g.

$("#AddressGrid").on("click", "td", function (e) {
    var row = $(this).closest("tr");
    var textVal = "";
    row.find("td").each(function(i, r) {
        textVal += `Col ${i+1}: ${r.innerText}\n`;
    });
    alert(textVal);
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I reference a specific cell in kendo grid with javascript?

How to display icon as a value on a Kendo Grid cell?

How can I get the selected row's value of a qtablewidget in PyQt?

How can i get selected value from a select component

How can I get grid-cell-collections from grid object?

How to get the value of checkboxes in a kendo grid

How to make kendo grid cell blank when field value is zero

How can I get the selected value from my <select>

How to get the value of a checkbox in a Kendo UI Grid?

how can i get selected value in jquery auto suggest plugin

How do i get hidden value from Kendo grid with onSave event

How do I get the index and data of a selected row in a grouped Kendo grid

How can I access the model for the selected item in a Kendo UI Grid

How to get Kendo Dropdown selected should fill Kendo grid

how to get value of selected cell in grid view in c#

how to check and change color of cell value in kendo ui grid

How can I get a datatemplate to fill uniform grid cell?

Update Kendo Grid selected cell value with the value in a Kendo Editor

How can i highlight the Kendo grid cell by color change after update

How can I change a wpf Databound grid cell based on the cell value?

how can i get the selected value of dropdown list in php?

How to get kendo grid filed value?

How to get the first row corresponding cell value if i change the other rows cell value in kendo child grid

How can I get selected value on the dropdown with vue.js?

How can i auto update a Kendo Grid?

How can I get selected value in select dom element [Laravel]

How can i get the value of the selected option using Javascript or Jquery?

How Kendo grid select row get the selected userID?

How can i get the textbox value in selected row in gridview