Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
row.cells is inconsistent
posted

I have a WebGrid with a button.  In the ClientSideEvents, I set ClickCellButtonHander to a javascript function, "ButtonClicked".
ButtonClicked has two params, gridName and cellid.
Using cellid, I get the row whose button was clicked [var myRow = igtbl_getRowById(igtbl_getCellById(cellid).Row.Id);]
myRow.length is always 8, the correct count; However, myRow.cells gives me anywhere from 2 to 8 cells, using the same grid
with the same data at the exact same row.  Why is it never consistent?  What is the problem?

 

thanks 

Parents
  • 180
    posted

    I discovered a workaround, but my original question still stands...

    since myRow.cells is inconsistent, I can't call myRow.getCellFromKey("itemnumber").getValue(), since that cell sometimes doesn't exist, thus, is null and that line causes an error.

    However, I can call parseInt(myRow.Element.cells[2].innerText) to get what I needed.  It seems myRow.Element.cells has the complete cell set, whereas MyRow.cells is iffy.

     

Reply Children