Master and slave datatables (dependent)

Hi All,

I’m struggling a bit with two dependent editable datatables. I can sync the master and the slave; however, how can I prevent the master to change selection when the slave is not valid. For example: The master datatable contains sales order headers and the slave contains sales order lines. In case that one of the sales order lines is not valid the master should not be able to change the cursor. I cannot find a way to enforce this since the onBeforeSelect happens before the onBeforeEditEnd… any ideas / suggestions?

Thanks, Martin

@zevenbergm
try to use webix.editStop() or slaveTable.editStop() in onBeforeSelect event

@integral : Good idea! Do you have any suggestions how I can await server response on the slave datatable? waitData is not helping much and waitSave only works for the inline code… I need to await the server response to make sure the slave is valid.

it depends on your data saving logic.
probably you need to use some intermediate promise object to catch operation start/end.

I think so too… but what is the best place… I was thinking about the onEditorChange or maybe onBeforeEditStart. What is your suggestion based on your experience? :wink:

I personally would not use this kind of sync.
instead I would open separate popup to edit lines and close it on save/cancel.