You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an exception for the above line, only when the dgrid has not loaded the rows so it returns a Row object in which 'element' is undefined.
However when I have 1000 rows in dGrid then if the first 100 rows are loaded then above code scrolls fine for the rows which are already loaded, but for the subsequent rows which are not loaded into view throws exception. (cannot read property 'offset' of null ) (I think this is because the element for the row is undefined since it is not loaded.)
Any idead on how do I load a row programatically so that the above code auto scrolling works.?
The text was updated successfully, but these errors were encountered:
Firstly, there is a scrollTo method on dgrid instances, which you can pass an object with x or y properties to scroll in a platform-agnostic manner (since scrolling is handled differently for touch devices).
Regarding the issue of rows that have not yet been rendered, well, yes, that's a bit of a tricky situation, since the rows haven't been rendered yet, and it would generally be a bad idea to pre-render all of the rows just for the sake of knowing where to scroll. What you can do, particularly if your rows tend to be uniform height, is make an educated guess as to what the scroll position of the desired row would be (by multiplying # of rows to scroll by the known height of one of the rendered rows), and using that as a y value passed to scrollTo. Once the scroll is performed, the items for that position within the grid will be requested.
For future reference, support questions like this are better posed to the #dojo IRC channel or dojo-interest mailing list to get a wider audience than the issue tracker, which is primarily for bugs or enhancements. See the Getting Support section of the README for details.
Below is the code where I wanted to scroll dynamically by giving the RowNo (Id).
Code: grid.bodyNode.scrollTop = grid.row(rowNo).element.offsetTop
I get an exception for the above line, only when the dgrid has not loaded the rows so it returns a Row object in which 'element' is undefined.
However when I have 1000 rows in dGrid then if the first 100 rows are loaded then above code scrolls fine for the rows which are already loaded, but for the subsequent rows which are not loaded into view throws exception. (cannot read property 'offset' of null ) (I think this is because the element for the row is undefined since it is not loaded.)
Any idead on how do I load a row programatically so that the above code auto scrolling works.?
The text was updated successfully, but these errors were encountered: