How to retain focus in a datatable cell if validation fails

Is it possible to retain focus in a datatable cell if validation fails. I don’t want to use onBeforeEditStop as it is fired before the automatic validation.
http://webix.com/snippet/d8d4098b

Check the updated snippet. The onBeforeEditStop still is the best place for such kind of logic. It possible to alter code to have both one-time validation and cell refocusing.

http://webix.com/snippet/65d7c594

Thanks !

Hi maksim, I have scenario some what as Baga is referring. However, can I make logical call to make onBeforeEditStart return true or false based on what validation I get in onBeforeEditStop in your snippet. Basically I want to restrict another editor to be active in case my validation fails or to make editor active in case previous validation pass.

The above sample already implement most of necessary logic, it has the onBeforeEdit start handler, that blocks new editor while previous editor is not closed yet.

The component runs events in the next order

  • new editor - onBeforeEditStart
  • old editor - onBeforeEditStop
  • old editor - onAfterEditStop
  • new editor - onAfterEditStart

So you can’t get the data from onBeforeEditStop in the onBeforeEditStart handler.

Still the original snippet can be improved a bit. Check the updated sample.

http://webix.com/snippet/bd6c9dd6

Thanks alot Maksim.