Grid / Combo Filter

We have this requirement and wondering if dhtmx has these abilities:

A grid with 2 columns has 2 combo filters and around 200 rows loaded via a grid.parse(data,‘jsarray’).

After column one is filtered via the combo, then column two’s combo needs to only show the values which are currently in the grid.

I did research the issue and it looks like the only way to make this happen automatically is by changing the dhtmlx code. Is this still the case?

Unfortunately such feature is not available.

Do you think it might be possible to create a comboRebuild() prototype which could be called from inside of onFilterEnd?

I would also be very interested in this feature, although a general solution for all filters and not just combos.

Unfortunately such feature is not available without code modifications.

I have come across a possible solution that adds this functionality. If you use a dataStore, and sync the grid to the dataStore via:

myGrid.sync(myDataStore, { sort: true, filter: true });

your grid filter boxes should now only show filter options for the currently view-able (aka filtered) data. The real solution here is the optional { sort: true, filter: true } parameter in the .sync() call, which as I understand it moves the filtering and sorting over from the grid to the dataStore directly. This solution is currently working for me (only tested with select_filters though), so I hope it helps you/others.

Best,
-S

When testing this with combo filters, it works the first time. When the filter is cleared by selecting the first blank option, then reopened the combo is empty.

I may have found a workaround by adding this event:

combo = grid.getFilterElement(1);  // get combo handle
  
combo.attachEvent("onChange", function(){
    this.openSelect();    // no idea why these are needed to make it work
});  

This makes the filter work the 2nd time.