Last change: September 4, 2019
Current version: 1.3.1
The crudList module creates and controles lists with create, read, update and delete options.
webanizr.collect('crudList', parameters, callack);
webanizr.send('crudList', data, parameters, callack);
collect
parameters
The crudList module accepts the following parameters:
id__list (required)
The dom id of the list.
id__template (required)
The dom id of the template used for displaying the list items
name__table (required when using the update-by-api or delete-by-api action in send)
The name of the table from which to collect the data.
type__table (optional whend using the update-by-api or delete-by-api action in send)
The type of the table from which to collect the data.
id__item (required by delete-by-api or delete-from-list)
The id of the item to delete
send
parameters
The crudList module accepts the following parameters:
type__action (required)
The type of action to perform. The following options are supported:
- pre-render-template: pre-renders a template using mustache and the data given
- update-by-api: uses the Webanizr headless api to update the list items
- set-list: set the data as the current list of items
- update-list: (re)render the list based on the available items in the list
- delete-by-api: delete an item using the Webanizr headless api
- delete-from-list: delete an item from the cache and from the screen
id__source (required by the pre-render-template action)
The id of the template to be pre-rendered
id__target (required by the pre-render-template action)
The id of the template to place the rendered template in.
callback
The callback is called after the action is performed.
Changelog
- September 18, 2019: 1.3.1 - updated the requirement on sendToAPI to 1.2.0
- September 4, 2019: 1.2.0 - added update-by-api, set-list and update-list as actions to crudList
- September 4, 2019: 1.1.0 - added the collect method
- September 4, 2019: 1.0.0 - added the pre-render-template action to send