BUG Datatable on Sort then FIlter is not working

Hallo,

The Datatable makes serverSide filtering and sorting.

The test case is.

  1. We filter the datatable and then we sort a column and the state is saved in localstorage.

  2. On refresh browser we set the state from the localstorage at onBeforeRender event. Unfortunately the sorted column and the filter are NOT applied on the Datatable because they are not posted.

INFO: If we only filter a column and we do NOT sort then the filter is posted but after doing the sorting and the filtering nothing works.

Its a huge bug and need fast fix.

And the snippet

http://webix.com/snippet/81af086e

FIlter the pc column and refresh the page.
The filter will stay.

Sort now also the num column.
Refresh the page. The filter not working

Hi,

Try to do next

  • remove “url” property
  • set the data url and call loadNext after applying the state

http://webix.com/snippet/e0f18d20

I have tried to find out from the webix_debug the problem. In setState there is the following code and little bit changed…

if (obj.filter){
		//temporary disable filtering 
		var temp = this.filterByAll;
		this.filterByAll = function(){};

		//apply defined filters
		for (var key in obj.filter) {
			var value = obj.filter[key];
			if (!value) continue;

			if (!this._filter_elements[key]) continue;
			var f = this._filter_elements[key];
			f[2].setValue(f[0], value);
			var contentid = f[1].contentId;
			if (contentid)
				this._active_headers[contentid].value = value;
		}

		//remove old filters
		for (var key in this._filter_elements){
			if (!obj.filter[key]){
				var f = this._filter_elements[key];
				f[2].setValue(f[0], "");
			}
		}
	
		//restore and apply filtering
		this.filterByAll = temp;
		//this.filterByAll(); **COMMENTED**
	}

	if (obj.select && this.select){
		var select = obj.select;
		this.unselect();
		for (var i = 0; i < select.length; i++)
			if (!select[i].row || this.exists(select[i].row))
				this._select(select[i], true);
	}

	
    if(obj.scroll)
        this.scrollTo(obj.scroll.x, obj.scroll.y);


    **SORTING HAS BEEN MOVED UNDER**
    if(obj.sort){
		var column = columns[this.getColumnIndex(obj.sort.id)];
		if (column)
			this._sort(obj.sort.id, obj.sort.dir, column.sort);	
	}
            **FILTER BY ALL FIRES AT THE END**
	if (obj.filter){
		this.filterByAll();
	}

With this way above the sorted column and filters are posted.

Thanks for the extra info, we was able to find the real reason of the issue. There was a regression which silently blocks the second server side request when multiple requests are issued at the same time. Fix will be available as part of Webix 4.3

looks is not fixed in 4.3 :frowning:

Not fixed for 4.3.1

Still for 4.3.2