To set focus on a DataView item, make use of the setFocus() method. It takes the id of an item as a parameter:
Editing itemsâYou can edit a particular DataView item with the help of the editItem() method. It takes as a parameter the id of an item:
Related sample: Dataview. Edit item using a button
Disabling and enabling selection of an itemâFor information on disabling/enabling selection of an item, read Enabling/Disabling Selection object.
Using Data Collection APIâYou can manipulate DataView items with the help of the Data Collection API.
Adding items into DataViewâIt is possible to add more items into the initialized DataView on the fly. Use the add() method of Data Collection. It takes two parameters:
config (object) the configuration object of the added item index (number) optional, the position to add an item atdataview.data.add({
"value": "Learning new DHTMLX" + " " + (2019 + i),
"thumbnailName": "61ot4vfL9HL.jpg",
"shortDescription": "Create your first single-page JavaScript application"
},0);
Related sample: Dataview. Add item using Form
Updating DataView itemsâYou can change config options of the item via the update() method of Data Collection. It takes two parameters:
id the id of the item config an object with new configuration of the itemFor example, you can change the value of an item:
dataview.data.update("item_id",{
value:"Nice item"
});
Related sample: Dataview. Edit item with Form
Removing items from DataViewâTo remove an item, make use of the remove() method of Data Collection. Pass the id of the item that should be removed to the method:
dataview.data.remove("id");
Related sample: Dataview. Delete item
Filtering DataView dataâYou can filter DataView data by the specified criteria with the help of the filter() method of Data collection. Check all details on parameters of the method in the Data Collection API.
dataview.data.filter({
by:"value",
match:2,
compare:(value,match,item)=>{ return parseFloat(value) % 2 == 0}
});
Related sample: Dataview. Filter
Sorting DataView dataâIt is possible to sort data in DataView via the sort() method of Data Collection.
Check all details on the parameters of the method in the Data Collection API.
dataview.data.sort({
by:"value",
dir:"desc"
});
Related sample: Dataview. Sorting
Using Selection APIâFor information on using Selection API, read Work with Selection Object.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4