Get grid cell value in javascript
New DiscussionHi,
I’m implementing a function (copy grid data to clipboard) that requires all grid values in a javascript. First, I looked examples and cannot find one. Second i looked document and cannot find instructioin. I looked into infragistic installed directory, and find some javascripts, use trial and error to find out each function. Is there better way? Where is complete document for using objects?
But I’m still having problems. I’m able to get cell object, but I don’t know how to get value. Here is how I get all cells:
function copyButtonClicked() {
var elm = document.getElementById(‘clipboardFormId:gridViewId’); // gridĀ component id
if(elm!=null)
{
var mygrid=ig.grid.getGrid(elm);
if(!ig.isNull(mygrid))
{
var gridbody = mygrid.getBody();
if(!ig.isNull(gridbody))
{
for(i=0; i<mygrid.getRowCount(); i++)
{
for(j=0; j<mygrid.getColCount(); j++)
{
var cell=gridbody.getCell(i, j);
…..
}
}
I’m stucked here, I don’t know what to do with object cell. How to get the value? I somehow get the innerHTML:
cell.elm.innerHTML
But it is not the value and somehow I cannot get column title.
I’m trying to find document for row, col and cell object function. I cannot find any. The online examples are not sufficient.
Please Help
Thanks
Yan