getValue - all values grid


Hi,

I’m a problem while running this code:



function onKeyPressed(code,ctrl,shift){
   if(code==67&&ctrl){
      mygrid.setCSVDelimiter("\t")
      mygrid.copyBlockToClipboard()
  }



if(code==86&&ctrl){
   mygrid.pasteBlockFromClipboard()
   mygrid.selectRow(0);
   //cols count
   var oCols = mygrid.getColumnCount();
   //rows count
   var oRows = mygrid.getRowsNum();
   for(x=0;x<oCols;x++)
   { 
      for(y=0;y<oRows;y++)
      {
          try
          {
              alert(mygrid.cells(x,y).getValue());
           }catch(e) {
                alert('Err : ’ + e.number + '\nDescription : ’ + e.description + ‘.’);
           }
       }
   }
   
  }
  return true; 
  }

The procedure is to rescue all the values of the cells and to compare when paste them
Thanks!<LINHAS;Y++) }
<COLUNAS;X++) }<COLUNAS;X++) }

alert(mygrid.cells(x,y).getValue());

The syntax of cells command is
    cells(rowId, cellIndex) - it mixed up in your case
The correct code will be

    alert(mygrid.cells2(y,x).getValue());

I used cells2 because it works with row indexes and more appropriate in your case