ParamQuery

General Category => Help for ParamQuery Pro => Topic started by: Digitalsoft on June 24, 2020, 11:30:13 pm

Title: Disable undo option for Tree addNodes action
Post by: Digitalsoft on June 24, 2020, 11:30:13 pm
It is mentioned in doc that 'Undo is supported and ui.source = "addNodes" in the events fired during the process' for addNodes action in Trees. Incase if we need to disable undo option and addNodes changes irreversible then do we have any option for the same, thanks!
Title: Re: Disable undo option for Tree addNodes action
Post by: paramvir on June 25, 2020, 10:15:07 am
History undo / redo can be disabled by setting

historyModel.on = false

https://paramquery.com/pro/api#option-historyModel
Title: Re: Disable undo option for Tree addNodes action
Post by: Digitalsoft on June 25, 2020, 10:28:00 am
We require to have historyModel for redo / undo for other action like cell update, cut/copy/paste in grid. Only that we don't want to track during tree lazy loading(through addNodes). In addRow method, there is option to limit the history specific to that operation. We are looking for anything similar to that in addNodes or any other way to achieve.
Title: Re: Disable undo option for Tree addNodes action
Post by: paramvir on June 25, 2020, 10:33:05 am
That makes sense.

There is alternative way to disable history specifically for addNodes.

Code: [Select]
beforeValidate: function(evt, ui){
if(ui.source=="addNodes"){
ui.history=false;
}
},
Title: Re: Disable undo option for Tree addNodes action
Post by: Digitalsoft on June 26, 2020, 11:31:57 am
Perfect, it does the job for our requirement..thanks!