Detect "open" editor

Hi,

I have a editable datatable and one save button (outside the table) which will trigger function. The function will loop datatables config.data and send them to the server. The problem I am facing here is that if editor is opened, then entered value will not be updated. The old data is sent. User needs to click somewhere at the screen to close editors and webix will recalculate data, but I can not guarantee that user will do this.

I understand why this is happening but I do not know if there is some solution that will “close” editors first, update datatables data and then run rest of the code. If I can detect somehow which editor and if any editor is open then I can take innerHTML from it and ignore config.data value.

Hi,

You can apply the editStop() method to the datatable before running the loop. It will close all the currently opened editors (if any) and save their data.

Bingo :slight_smile: editStop() does exactly what I need.

Othervise, there is solution to disable save button onBeforeEditStart event and then enable it onBeforeEditStop. It forces user to exit editor before he can save. It is visible to user but at least it works…

But your solution is way smoother.