:: DHX Grid :: Filter based on two column values

Hi there,

I want to filter the rows in the grid based on two column values.

I am doing following

First I run filterBy() API to filter rows based on one column value and then on those filtered rows, I will run another filterBy() API again to filter rows based on second column value.

If this is not possible, can we do this ?

onFilter or onFilterEnd event, we can hide rows not satisfying filter criteria ?

Can u help me on this please ?


Please see example at the attachment
sample1.zip (133 KB)


I saw the example, but can you provide example for something like this ----> When I click on some button which is not in context of grid, I will run one filterBy(); based on that some rows will be filtered. Then try to filter some more rows searched from #text_filter present in the grid itself. Means suppose at load say there are 100 rows, then based on first filterBy() API called on click of the button, 25 rows got filtered[Remaining Rows: 75], now out of 75 rows, I want to filter again more rows based on #text_filter. How to do this ?

To create filter outside the grid:

function filterByAuthor(){
var aVal = document.getElementById(“author_flt”).value.toLowerCase();

By default #text_filter run against all rows in grid, but you can inject additional rules through onFilterStart event

a.push( document.getElementById(“author_flt”).value );
return false;

as result, each time when text filter triggered - it will filter grid not only by own value, but include value of external filter as well

>>I will run another filterBy() API again to filter rows based on second column value.
Technically yes, third parameter of filterBy says is filtering need to be done on full dataset ( false ) or already filtered dataset ( true ) - it can be used if you filter data only by filterBy calls.