Author Topic: Combining Remote and Local Filter  (Read 2197 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Combining Remote and Local Filter
« on: July 27, 2016, 08:35:24 pm »
I currently use remote data, remote sort and remote filter.  All works fine.

I now have a new column that I need to filter locally once the remote data is displayed on grid.  The reason this column needs a local filter is that it would otherwise change the whole dataset and upset some calculations if the data is actively removed...I just want to able to filter the grid results without affecting the rest of the row.

I read one of your other forum responses which suggested switching to local filter temporarily and then reverting back to remote after the local filter had been applied.  Is this the best/only approach or can I set an individual column to be a local filter only?  Either way I'm not really sure how to do it.

Hope you can help.

Regards, Tony.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Combining Remote and Local Filter
« Reply #1 on: July 27, 2016, 11:52:42 pm »
It's either remote filtering for all columns or local filtering of all columns. it can't be mixed with each other.

If you wish to apply local filtering on one column after the remote data is loaded, then you need to switch the filterModel.type to 'local' and

use oper: 'replace' in filter method which would replace/clear the old filters. with a new one on the desired column.

http://paramquery.com/pro/api#method-filter

Trade off is that if you make a remote request again, you won't get the previous filter information on other columns as it would be lost by oper: 'replace'.
« Last Edit: July 27, 2016, 11:56:39 pm by paramquery »