Live Data JavaScript API
Last modified by Eleni Cojocariu on 2026/09/11 15:51
Reference
Live Data provides a JavaScript API on the container of each instance, reached through the liveData jQuery data-property (as in jQuery("#wikis").data("liveData")) and in Live Data events.
Methods
| Member | Returns | What it does |
|---|---|---|
| getLayoutIds() | An array of layout ids | Lists the layouts the reader may switch to |
| getPropertyDescriptors() | An array of property descriptors | Lists the properties the instance knows, with their type, their displayer and their filter |
| updateEntries() | Nothing | Reloads the entries, with the filters and the sort currently applied |
jQuery("#myld").data("liveData").getLayoutIds();
jQuery("#myld").data("liveData").getPropertyDescriptors();
jQuery("#myld").data("liveData").updateEntries();HTML Attributes
These attributes select Live Data elements without depending on a layout, which is what makes a stylesheet or a test survive the reader switching layout.
| Attribute | Set on | Holds |
|---|---|---|
| data-livedata-property-id | Every property displayer | The id of the property being displayed |
| data-livedata-entry-index | The root element of an entry | The index of that entry in the page of results currently displayed |
| data-livedata-entry-id | The root element of an entry | The value identifying that entry |
FAQ
How do I reach the API of a Live Data whose id I know?
Through the liveData jQuery data-property of its container, as in jQuery("#myld").data("liveData").
How do I refresh a Live Data after changing its data elsewhere?
By calling updateEntries, which reloads the entries with the filters and the sort currently applied.
Why select elements through these attributes rather than through CSS classes?
Because they are the same in every layout, so a selector built on them survives the reader switching layout.