Any way to obtain rows currently in viewport using infinite scroll?

48 views
Skip to first unread message

xve...@wovenware.com

unread,
Mar 20, 2018, 11:17:43 AM3/20/18
to UI-Grid Support
Posted my question in Stack Overflow here, but considering there are no replies...

Copy pasting:

I'm using UI-Grid with Infinite Scrolling and I would like to obtain only the rows that are displayed on the screen of a user in order to send them to a modal window for editing (as requested by the user, they want to do this outside of the current view).

How could I achieve this? Let's say in a 1920x1080 screen, the screen is able to show 25 rows, I would like to get those 25 displayed rows. Obviously this number varies according to screen size and/or resolution, so I would like to capture depending on these two and if not, then at least assign a standard 25.

Is this possible somehow?


I looked into rowTemplates and implemeting angular-in-viewport like so:

rowTemplate: '<div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + \'-\' + col.uid + \'-cell\'" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" role="{{col.isRowHeader ? \'rowheader\' : \'gridcell\'}}" ui-grid-cell viewport-enter="" viewport-leave=""></div>'


But I'm lost as to where I could flag a something as visible using this method. Furthermore, this puts angular-in-viewport tags on every cell in the row, and upon inspection in this group I found out I cannot modify the viewport template to include these tags.

Any ideas? And is this a step in the right direction?
Reply all
Reply to author
Forward
0 new messages