Add and remove rows

Hi,
I am trying to add and remove rows from the grid on selection and deselection of checkbox control through js function. I have used following code to add row:

webix.$$(“cxdetailsgrid”).add({ _Name: name, _ID: newGuid, _Description: “”, id: rowId, _indexer: newGuid });

It adds the row but “$$(“cxdetailsgrid”).config.data” does not get updated. which causes problem in deletion. So I tried pushing that same data object to config.data

webix.$$(“cxdetailsgrid”).config.data.push({ _Name: name, _ID: newGuid, _Description: “”, id: rowId, _indexer: newGuid });

But that still didnt resolve the issue. I am not able to delete that row.

this.config.data is a reference to the initial dataset and it is not related to the actual state of datatable. So adding new row to the datable will not affect it ( at least it is not expected )

If you have problems with data deletion, please share a link or a snippet.

Thanks. issue is resolved

Is there any way we can update the webix.$$(“cxdetailsgrid”).config.data ppty once we add a row using .add()

Nope, but you can use $$(“cxdetailsgrid”).serialize() to get the same object with the actual data

Thanks. that worked :slight_smile: