Multideleting items from datatable (ajax.del)

edited January 10 in Technical questions

How to multidelete items from datatable?
I'm getting "Bad Request":(
How to fix this?

function removeItem() {
let selectedId = $$("vaultOverflowTable").getSelectedId();
webix.ajax().del("http://localhost:1337/question", { id: selectedId });
if (selectedId) {
$$("vaultOverflowTable").remove(selectedId);
}
$$("vaultOverflowTable").clearAll();
$$("vaultOverflowTable").load("http://localhost:1337/question");
}

Tagged:

Comments

  • edited January 14

    Hello @arik,
    getSelectedId(true) returns ids as an array of objects.
    If you can adjust the server side code, you can send the array of ids to the server side:

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

    You can also send the parameter in a simpler format as in the example: https://snippet.webix.com/ay2u93xt

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion