Deleting multiple selections in datatable

Hi,

i have a datatable with the “select” column.
After i select lets say 10 “rows” i hit the “Delete” button and i would like those rows be deleted in backend DB.

In my app i dont use DataProcessor, i only use simple “webix.ajax().post()” calls.

Now i know how to delete a single row (by passing a parameter to my “webix.ajax().post(url, {id: product1}, function(text, data){//callback code});” function. But what if i want to delete 500 rows?

Should i call this POST request 500 times or should i implements this in some other way?

regards

If you can adjust the server side code, you can send the array of ids to the server side

webix.ajax().post(url, {
   id: grid.getSelectedId(true) //will send an array of ids
}, function(text, data){//callback code});

Hi,

actually i found out that the getSelectedId does not work for “checkboxes”. I have a column with checkboxes and after i select lets say 10 of them (each in its own row) and hit the Delete button, the getSelectedId only returns 1 ID.

This got me troubeled a long time until i found this answer:
forum.webix.com/discussion/3804/capturing-checked-rows-in-datatable

So now im fine:) I also implemented a server side code that goes trough an array of IDs and deletes the items in DB.

Thanks