datatable default sort

Is there a way to define a default sort for each operations made in the datastore of a datatable so i don’t have to play with events ? Each time a record is added/modified/deleted, the datatable is redrawned with the sort i’ve defined somewhere.

https://snippet.webix.com/9mu1djv4 (no sort)

AFAIK you need to call filterByAll on “data->onStoreUpdated”

{
   on:{
      'data->onStoreUpdated': function(id, obj, mode){
         if(["update","add","delete"].indexOf(mode)>-1){
            this.filterByAll();
         }
      }
   }
}

Good hint ! But does not work in this snippet

https://snippet.webix.com/kow97h7b

wait

Missing where i can define the attribute (column) on which data must be sorted

sorry, filterByAll affects sort only in dynamic mode.
in your case, as you sync data, I would prefer this way:
https://snippet.webix.com/yaq4thku
but this will affect combo sorting too.

Well, it’s perfect like that ! Thank you !

By the way, to affect just datatable sorting, you can use a sync callback:

$$('datatable').sync(store, function(){
	this.sort("MYATTRIBUTE","asc","string");
});

https://snippet.webix.com/161p7n8b

Yep, thank you Helga