Get the value from cell

Hi 4 everyone …

First i would like say to us congrats to the great job that the DHTMLX does, actually im working with Data Grid and i would like when i select one row, this gave me the value of this row, and if is possible only two cells.

I’ve read documentation of the method Rowselect but honestly I do not quite understand, appreciate if someone could support me.

This is my code …


	<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />

<body onload="doOnLoad();">
    <div class="content">
<link rel="stylesheet" type="text/css" href="dhtmlxLayout/codebase/dhtmlxlayout.css">
<link rel="stylesheet" type="text/css" href="dhtmlxLayout/codebase/skins/dhtmlxlayout_dhx_skyblue.css">
<script src="dhtmlxLayout/codebase/dhtmlxcommon.js"></script>
<script src="dhtmlxLayout/codebase/dhtmlxlayout.js"></script>

<link rel="stylesheet" type="text/css" href="dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">

<script src="dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script src="dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>

<link rel="stylesheet" type="text/css" href="dhtmlxTree/codebase/dhtmlxtree.css">

<script src="dhtmlxTree/codebase/dhtmlxtree.js"></script>

<script src="dhtmlxLayout/codebase/dhtmlxcontainer.js"></script>

<div id="parentId" style="position: relative; top: 20px; left: -20px; width: 1174px; height: 700px; aborder: #B5CDE4 1px solid;">

<div class="footer">
    <div class="footer-logo"></div>
    <div class="copyright">Copyright &copy; 1998-2009 DHTMLX LTD.

All rights reserved.


As per your code you havened defined “onRowSelect” event handler.

function doOnMemRowSelected(row_id,cell_index){ //any code here }

Thx Olga, the deal it’s get the value selected by the cell not the row, how to do that ?


You can get selected row id with getSelectedRowId() method.
You can get selected cell index with getSelectedCellIndex() method.

Hi Olga i tryied the next code with out result can you help me please ?

[code]function doOnRowSelected(id) {
protocolIt(“Rows with id: " + id + " was selected by user”);

function protocolIt(str) {

var p = document.getElementById("protocol");

var p_2 = dhxGrid.cells(p,2).getValue();

p_2.innerHTML = "<li style='height:auto;'>" + str + "</li>" + p_2.innerHTML


Check if “p” points to real row id.