Closed royling closed 8 years ago
Sorry for the silence. The real answer is: I don't know - I haven't delved into the rendering code of the grid for a while. But having a quick look over it, I'd say the rowIndex properties are fairly self explanatory, since the grid only displays whole rows. It appears to use the viewport element height to work out how many rows to display. The leftPx property is basically just the scrollLeft property of the viewport element and rightPx is leftPx plus the viewport width (including scroll bar, if present).
@6pac thanks for answering, got the answer from the source - https://github.com/mleibman/SlickGrid/blob/2.1/slick.grid.js#L1665-L1666
I posted a question in google group - https://groups.google.com/forum/#!topic/slickgrid/8aRagN6TM9Y but don't know if the group is still active for discussion or not, so repost it here (sorry for that - I know it's not the right place for a question).
Can anyone help?
My original question: from the documentation - https://github.com/mleibman/SlickGrid/wiki/Slick.Grid#getViewport, it says
grid.getViewport()
returns an object withleftPx
andrightPx
properties, and they are:what's the meaning of left/right scrolling offset? Does it mean leftPx for vertical scrolling while rightPx for horizontal scrolling or the opposite?
I tried to log the result and compare them against the clientHeight/clientWidth of the canvas node element, it sounds so. Does anyone know about this or confirm if my guess is right?
Thanks!