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've already posted this on Stack Overflow (link here), but since I got no answers, I decided to post it here. Sorry if this is not a good place for that
I've been struggling for a while with this issue. In my application, I'm using an OnDemandGrid, backed by a Request + Trackable dstore, to display my data to the user.
The server sends notifications to the client via websocket to add new entries to the grid. To add the new entries to the grid, the store is emiting an 'add' event, something like the following piece of code:
Until here, it's all good. The application receives the new entry from the server to be added to the grid, and adds it (without refreshing the grid). The problem is if there are too many notifications being sent by the server during a small time interval. The store emits all the events to the dgrid, but the grid tooks some time to render all the rows. Because there are too many entries to be added, the application goes unresponsive. If the server stops sending data to the client, after some time the application recovers and render all the rows correctly. Now comes the second (but minor) issue.
The second issue is that, after the grid renders all the new rows, it does not destroy the rows that are too far. I've set the farOffRemoval attribute, but it seems to only handle cases where a scroll happens and new data is requested to the server. I would like to know if there is a workaround, that does not rely on scroll, to destroy nodes that are too distant from the user current position on the grid.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I was going to suggest using throttling for the first part, which it sounds like you've done. As far as triggering the removal, you're right in that a scroll event usually triggers that. I would think you could emit a 0px or 1px scroll event on the dgrid instance? Otherwise I think you might need to reimplement something like https://github.com/SitePen/dgrid/blob/b1603c6c0359896060cfe02cf0dd250cf1ce9239/OnDemandList.js#L461 . Another option is to periodically refresh which might be sufficiently fast as long as it works against cached data.
I've already posted this on Stack Overflow (link here), but since I got no answers, I decided to post it here. Sorry if this is not a good place for that
I've been struggling for a while with this issue. In my application, I'm using an OnDemandGrid, backed by a Request + Trackable dstore, to display my data to the user.
The server sends notifications to the client via websocket to add new entries to the grid. To add the new entries to the grid, the store is emiting an 'add' event, something like the following piece of code:
Until here, it's all good. The application receives the new entry from the server to be added to the grid, and adds it (without refreshing the grid). The problem is if there are too many notifications being sent by the server during a small time interval. The store emits all the events to the dgrid, but the grid tooks some time to render all the rows. Because there are too many entries to be added, the application goes unresponsive. If the server stops sending data to the client, after some time the application recovers and render all the rows correctly. Now comes the second (but minor) issue.
The second issue is that, after the grid renders all the new rows, it does not destroy the rows that are too far. I've set the
farOffRemoval
attribute, but it seems to only handle cases where a scroll happens and new data is requested to the server. I would like to know if there is a workaround, that does not rely on scroll, to destroy nodes that are too distant from the user current position on the grid.Thanks in advance.
The text was updated successfully, but these errors were encountered: