How can i get previous selected item in datatable

Hi Webix team,

i m using webix datatable control inside webix jet application and while selecting rows i want to get previous selected row id. How can i achieve this??

use onBeforeSelect event
https://docs.webix.com/api__ui.datatable_onbeforeselect_event.html
https://snippet.webix.com/7z9dljkx

@intregal thanks a lot for quick answer i m using custom control

webix.protoUI({
name:“schemafields”,
getValue:function(){
return this.serialize();
},
setValue:function(values){
this.clearAll();
this.parse(values);
}
}, webix.ui.datatable);

with this control i m always getting undefined for this.getSelectedId() inside onBeforeSelect method

this code should not break anything.
only first time onBeforeSelect -> getSelectedId() can be undefined.
check other parts of your code.

@intregal thanks it worked there was some typo in my code