datatable row counting and sorting

In my datatable i need to have row counting which i get like this:

scheme:{
	$init: function(obj) { obj.row_count = this.count();}
}

also i need to sort data in this table which i get like this:

	this.sort("sorting", "asc", "int");
}

And as sorting happens after initialization all my row counting breaks. How can I solve it?

In the $init key the data attribute sets only once on data init.

The related method is getIndexById. For showing the indexes without the data modification, you can use thetemplate. In another case, you need to modify each item in onAfterSort event:

http://webix.com/snippet/62c7b4c3