Articles in this section
Category / Section

How to get Data table row value on onclick event using JavaScript?

4 mins read

You can get the grid row details inside the click event by passing the target element to the “getRowInfo” method of the Grid component.

This is explained in the following sample code in which the “click” event has been bound to the Grid element and clicked row details are retrieved by using the “getRowInfo” method. The detail is displayed in the console window.


var grid = new ej.grids.Grid({
  dataSource: data,
  columns: [
    { field: "OrderID", headerText: "Order ID", width: 120, textAlign: "Right" },
    { field: "CustomerName", headerText: "Customer Name", width: 150 },
    { field: "Freight", width: 120, format: "C2", textAlign: "Right" },
    { field: "ShipCountry", headerText: "Ship Country", width: 150 }
document.getElementById("Grid").addEventListener("click", function (args) {
  if ("e-rowcell")) {
    var rowInfo = grid.getRowInfo(;
 // Get row information



Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment