It is clear from this example: http://docs.webix.com/samples/15_datatable/02_sorting/03_sort_api.html
How to reproduce:
- Click on “sort by title” button
- Then click on the “Title” header cell - nothing happens
- Then click on the “Title” header cell again - now it finally filters DESC
From 2.1.14 debug.js:
markSorting:function(column, order){
if (!this._sort_sign)
this._sort_sign = webix.html.create(“DIV”);
webix.html.remove(this._sort_sign);
if (order){
var cell = this._get_header_cell(this.getColumnIndex(column));
if (cell){
this.sort_sign.className = "webix_ss_sort"+order;
cell.style.position = “relative”;
cell.appendChild(this._sort_sign);
} else {
this._last_sorted = column;
this._last_order = order;
}
}
As can be seen from the code, internal variables this._last_sorted and this._last_order are only set if the header cell is not found (before initialization).
Workaround (hack) is to call “markSorting” once on the “onStructureLoad” event (when the “cell” is not yet initialized) and then again when you need to.
Hope this helps improve Webix!