Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by GZ on Jan 17, 2008 07:00
open dhtmlx forum
events on a dhtmlXGridFromTable

Hello,

I'm trying to adde events  on a dhtmlXGridFromTable grid. The following hrml doesn't work,could provide me some help?

regards

 

<script>

 function doOnRowSelected(){
         alert("alerti ");
        }

var  mygrid2 = new dhtmlXGridFromTable('tblToGrid');
 mygrid2.setOnRowSelectHandler(doOnRowSelected);

</script>


    <table id="tblToGrid" class="dhtmlxGrid" imgpath="../img/" style="width:400px" lightnavigation="true">

        <tr>

            <td type="ro">Column 1</td>
            <td>Column 2</td>
        </tr>

        <tr>
            <td>value 11</td>
            <td>value 12</td>
        </tr>
 </table>

Answer posted on Jan 17, 2008 08:54
Grid can be initialized from HTML table

a) by command dhtmlXGridFromTable
b) automatically by using dhtmlxGrid css class

In you case both methods used, so grid initialized two times - which can cause not predictable problems , to resolve problem just remove class="dhtmlxGrid" from source table.