Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by DaveSawers on Nov 14, 2007 15:21
open dhtmlx forum
How to get grid object in JavaScript?

How can I get JavaScript to find the grid object so I can perform actions on it?

I want to be ableto do something like:

mygrid = document.getElementById('????');
mygrid.something(...);

But what is the grid id?
Answer posted on Nov 15, 2007 01:13
If you creating grid by js code or by dhtmlXGridFromTable command - you get grid object as result of operation.
If you initializing grid from HTML, you can grid object by "name" attribute

<table name="aGrid ....


<script>
    aGrid.cells(i,j).getValue(...

Please beware that grid object will be available only after document loading.