How to disable KendoGrid RemoveRow function from invitation?

I am using the Kendo Grid removeRow function. It works, but always asks, "Are you sure you want to delete this entry?" whenever I programmatically delete a line. I have already decided whether to delete the line, so I do not want this message to be displayed. Googling did not help, and I could not find a single similar question in the StackOverflow or Kendo forum. I know I can change the code, but I was wondering if there is a way to set up the grid to just not show it? Perhaps another solution might be to temporarily block confirmation prompts, maybe? Not sure if this is possible.

+4
source share
2 answers

Setting editable.confirmation - false should do the trick:

 kendoGrid( { editable: { confirmation: false } }) 
+6
source

I have a workaround that I just figured out in the meantime. It works great, but a bit hacked.

 var oldConfirm = window.confirm; window.confirm = function() { return true; }; grid.getKendoGrid().removeRow(selectedRow); window.confirm = oldConfirm; 

Anyway, I will be interested to know about any disconnection of confirmation, and I will agree with this in return if this happens.

+1
source

Source: https://habr.com/ru/post/1438984/


All Articles