Author Topic: Undo works even historyModel is off  (Read 1603 times)

michaelapospechova

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 2
    • View Profile
Undo works even historyModel is off
« on: February 06, 2018, 06:18:58 pm »
Hi

If i delete content of cell by key delete, undo reverts previous value if I press CTRL+Z even if historyModel is disabled.
Tested on version 3.4.1 here http://jsfiddle.net/eLs8jyq6/
Is it bug or wrong configuration?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6264
    • View Profile
Re: Undo works even historyModel is off
« Reply #1 on: February 06, 2018, 11:57:23 pm »
That seems like a bug with historyModel.on

beforeValidate event can be used for the same:

Code: [Select]
       beforeValidate: function(evt, ui) {
         if (ui.source == 'undo' || ui.source == 'redo') {
           return false;
         }
       }

http://jsfiddle.net/eLs8jyq6/1/