Add the ability to have JS callbacks for events in Vue admin tables.
This is part of a PR going into 3.5 #6409
Information going into the README:
| Name | Data | Scenario |
| ------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| onSelect | Array of IDs | When a checkbox or select all is selected or de-selected. |
| onData | Array of objects | On successful load or page change. |
| onLoaded | - | When the table has loaded (regardless of data loading). |
| onLoading | - | When the table is in a loading state. |
| onPagination | Object | When pagination has loaded (also occurs on first load). Object contains pagination information (e.g. current page, total pages etc). |
Example usage:
new Craft.VueAdminTable({
// ...
onLoaded: function() { console.log('LOADED!'); },
onData: function(data) { console.log('Data:', data); }
// ...
});
Most helpful comment
This is part of a PR going into 3.5 #6409
Information going into the README:
| Name | Data | Scenario |
| ------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| onSelect | Array of IDs | When a checkbox or select all is selected or de-selected. |
| onData | Array of objects | On successful load or page change. |
| onLoaded | - | When the table has loaded (regardless of data loading). |
| onLoading | - | When the table is in a loading state. |
| onPagination | Object | When pagination has loaded (also occurs on first load). Object contains pagination information (e.g. current page, total pages etc). |
Example usage: