Suite 8 : Questions about getHeaderFilter()

I’m testing suite 8 and the new getHeaderFilter()

  1. is there a simple way to have the value of a filter ?
    (without using beforeFilter and filterChange)

  2. is there a simple way to have the type of a filter (inputFilter,selectFilter,comboFilter) ?

Thx

Hello.

  1. is there a simple way to have the value of a filter ?
    (without using beforeFilter and filterChange)

You may try to use
grid.getHeaderFilter(id).value
for the input/select filter
For the comboFilter the solution is pretty complicated.
I’ve sent your request to the dev team and we’ll extend the “getValue()”-like method for the getHeaderFilter, so you will be able to get the filter value.

  1. is there a simple way to have the type of a filter (inputFilter,selectFilter,comboFilter) ?

You may try to get it from the grid columns config
grid.config.columns[col-ind].header[header-row-index].content
or
grid.getHeaderFilter(colId).column.header[header-row-index].content

For point 1),
effectively
it’s a good idea to have grid.getHeaderFilter(id).value for the input/select filter → that’s ok for me
For comboFilter : → i wait for it ! (perhaps returning an array of values ?)

For point 2), ok but little painfull (iterating on header-row-index)

My apologies.

You can get the value of the comboFitler using the following code:

grid.getHeaderFilter("col-id").getFilter().getValue(); // array of options
grid.getHeaderFilter("col-id").getFilter().getValue(true); // list of options

The case is that
grid.getHeaderFilter(id).getFilter()

method returns the dhx.Combo object for the comboFilter:

So you can use its API to operate with it.