Live Data - Remote Polling
If you are handling a live data feed, you can initialize your dataset to perform ajax-based polling at regular intervals to fetch your data. There are three different ways in which this data can be merged into your existing dataset:
- Appended (default) - All new rows will be appended to the end of the dataset.
Reset - All the current rows in the dataset will be thrown out and the new rows will be put into
the dataset. To enable this, set
truewhen initializing your dataset. This will fire a
resetevent on a syncable dataset.
Unique - By specifying a column on which the data is supposed to be unique, new incoming
rows will only be added IF the value in that column is unique. To enable this, set
uniqueAgainstto the column name you wish to check against. Note, this is an expensive operation!
If you have
sync set to
true when initializing your dataset, then
fetch calls that append data in either the default manner or unique manner will trigger the "add"
event. The resetOnFetch will trigger the "reset" event before triggering the "add" event.
In all cases, the "add" event will be triggered once for all rows that were added.