We want to display live stock price information from a websocket to a table.
We realize that only a small portion of the data are visible on the screen while the rest are out of view. We are using the Virtual DOM.
We examined the ajax progressive loading API, but that is not suitable for live data.
We were considering if it were possible that we send all the key columns in the beginning to populate the table, then if the table could inform us of what rows are currently visible, so we can send the live data only for those visible rows.
Columns:
Stock Name (key, filterable, sortable)
Buy Price
Sell Price
I guess tabulator can determine which rows should be rendered, we would like to know them as well, so that we limit our websocket to stream only the data currently in view.
I propose the addition of an event: visibleItemsChanged(DataItem[] items) which would trigger when tabulator decides on rendering a different subset of the items. This would allow us to change the subscription list, and start streaming data for the new items in view.
Hey @leleftheriades
I wouldn't be looking to add a visible items changed callback as the scroll callbacks essentially serve this purpose anyway.
But i am currently tinkering with the virtual DOM to allow for the retrieval of the currently visible rows for the 4.3 release so i can certainly add a function you can call to find which rows are visible.
I will flag this as a feature for inclusion.
Cheers
Oli :)
that would be awesome, thank you :)
Hi @olifolkerd, I'm interested in being able to get the currently visible rows from the virtual DOM as well, any ETA on when 4.3 is planned for release?
Hi Oli, thank-you for adding the feature, we are now using the getHtml(true,true) and getting the visible rows. We can not find the scrollbar callbacks, so we are currently using a timer to check for differences. Will the scrollbar callbacks be available in a future release?
Hey All
You will be happy to hear that i have just pushed some updates to the 4.5 branch that will allow you to retrieve visible rows from the table:
var rows = table.getRows("visible");
This will be released in the next few weeks.
Cheers
Oli :)
Hi All,
You will be happy to hear i have just pushed some updates to the 4,5 branch that will allow you to track table scrolling,
There are two new callbacks, scrollHorizontal and scrollVertical
var table = new Tabulator("#example-table", {
scrollHorizontal:function(left){
//left - the current horizontal scroll position
},
});
This will be released in the next few weeks.
Cheers
Oli :
Most helpful comment
that would be awesome, thank you :)