Disable delete action row when drag row from a datatable to an another

Hi team,

I tried to disable the delete operation just when i move a row to another datatable
i’m ok the row desapear but i dont want delete it from database
i’m ok when to delete a row with a context menu to delete it

https://snippet.webix.com/a590f427

Could you tell me how disable deletion when i move à row please ?

Hello @XavierDP,

I tried to disable the delete operation just when i move a row to another datatable

You can redefine the default DnD behaviour inside of the onBeforeDrop handler and replace the move() operation with copy() (which will create a copy of the target element instead of moving it, as you might’ve guessed) - https://snippet.webix.com/cqlzfgup.

@Dzmitry

ok thank you for your anwser

but i wish remove the source row from datatatable when i move it without execute the delete serverside in this case

i want to keep the delete serverside when i choose to delete the row

can you help me please ?

i loosed the ability to delete manualy a row in the source datatable because i disabled delete ability in the source datatable

i don’t know how to know the source event of the delete (move or real delete)

$$(“theRightTable”).remove(item.id) launch the delete operation

here my code in the destination datatable :

`

onBeforeDrop: function (context, event) {

                var thisView = this

                var item = context.from.getItem(context.source[0]);
                bs.log("onBeforeDrop", context)
                if (context.from.config.id == "theRightTable") {

                    var input = { administrative_clause_profil_id: $$("theLeftTable").getSelectedItem().id }

                    webix.ajax().post('/wx/administrative_clause_list/max/', JSON.stringify(input)).then(function (output) {
                        var data = output.json()

                        thisView.add({
                            label: item.label,
                            administrative_clause_id: item.id,
                            administrative_clause_profil_id: $$("theLeftTable").getSelectedItem().id,
                            order: data.data
                        })
                        bs.log(data)
                    })


                    $$("theRightTable").remove(item.id)

                    return false
                }
            },

`

i found my solution : i let disabled by default automatic deletion and i delete the row myself in the delete context menu

but it exists an elegant Webix way to do that ?