Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by lmenuge on Dec 10, 2007 02:41
open dhtmlx forum
dhtmlxgrid event setOnRowSelectHandler problem

Hi all,

Here is my code:
Javascript:
mygrid.setHeader("Toto , img");
mygrid.setInitWidths("*,30");
mygrid.setColAlign("center,center");
mygrid.setColTypes("ro,ro");
mygrid.setColSorting("false,false");
mygrid.enableTooltips("false");
mygrid.enableAutoHeigth(true);
mygrid.setOnRowSelectHandler(doOnRowSelectHandler);
mygrid.init();
mygrid.loadXML("grid.php");

function doOnRowSelectHandler(rowId,cellId){
alert('');
}


grid.php:
<?php
$xml='<?xml version="1.0" encoding="UTF-8"?><rows><row id="40"><cell>Toto</cell><cell>courbes</cell></row></rows>';

header('Content-type: text/xml');
echo $xml;

?>


Here is my problem:
The display of the table is OK.

The first time I click on the row, an alert appears. But the second time, nothing appears... The row seams to be locked...
Where is the problem?I don't understand!!

Thanks in advance


Answer posted by Support on Dec 10, 2007 02:57
setOnRowSelectHandler react only on row selection changes, so if you have one row selected and click on another - handler code will be called, but if you click on already selected row - it will be processed without event handler call.

If you need to have a call for each click inside row, you can use next syntax of command

mygrid.setOnRowSelectHandler(doOnRowSelectHandler,true);