Hi Paul Kocher,
Thanks for contacting Syncfusion Support.
Query: I need to remove items from the ListView but it doesn't work as expected
Intellisense in VS Code gives me errors though.
We have analyzed the shared code snippet and the dataSource id is not properly referred in removeItem method. The removeItem removes the items from listview based on field item mapping with datasource. Please refer to the below code snippet to remove the Item from dataSource.
Regarding Intellisense error:
Yes, this is a known issue at our end and the fix for this issue will be available in out upcoming Volume 3 SP1 release. Please make use of the below highlighted work-around to get rid of this issue.
|
deleteItem(args) {
listObj.removeItem(<{[key:string]: string} >{allergy: 'Dust Allergy', allergyid: '5e26'})
} |
Query: I suppose I need to remove it by the actual field (allerdyId). Also, I read I can pass "Fields" to the removeItem method. How would I do that?
Yes, removeItem method removes items based on the name of actual field that is set in fields property as given below. So that you can remove items based on “alleryId”.
|
this.fields = { text: "allergy", id: "allergyid" }; |
Also, to remove multiple Items from Listview, you can use removeMultipleItems API available in Listiview.
We request you to go through the below help documents to get a solid understanding of Listview.
Please let us know if you have any further queries.
Regards,
Deepa L.