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
435
Get reference to row object if I have a reference to the actual <tr> element
posted

Is it possible to do this without using igtbl_getSomethingById()? I'm trying to optimise iterating through rows in client script to set a value in a cell in each row and it's much much quicker to do this by getting the underlying table row and using the nextSibling property. However I still need access to the row object to set the value of the cell properly. Is there an efficient way to do this if I already have a reference to the table row element? Some undocumented attribute maybe?

In a grid with 150 rows and 6 columns it can take 150ms for igtbl_getRowById() to return or for that matter getRow(), getChildRow() or getNextRow(). Using nextSibling on the table row element is near enough instant.

 

 

  • 435
    posted

    I should also add that it's only slow the first time. It appears that some caching is going on after the first access of an element so it's very quick if I rerun the same code.