Filter elements not showing

Posted by: lxrp-bst on 5 June 2022, 6:26 pm EST

  • Posted 5 June 2022, 6:26 pm EST

    Hi,

    I am storing the layout (filter s and column layout) of a flex grid for reconstitution.

    When the grid is serialized to JSON using:

    	var filterPayload = c1.getExtender(grid, "filter").filterDefinition;
    

    and stored in the DB, its UniqueValues property is null.

    When I reconsitute the FlexGrid with the filters applied

    	c1.getExtender(grid, "filter").filterDefinition = filterPayload;
    

    Only the values in ShowValues appear in the Filter dialog.

    Is the best way to allow all possible values to appear something like:

    var filter = c1.getExtender(grid, "filter");
        var filterPayload = filter.filterDefinition;
        var jsonFilterPayload = JSON.parse(filterPayload);
        for (var i = 0; i < jsonFilterPayload.length(); i++)
        {
            var colFilter = filter.getColumnFilter(i.binding);
            i.uniqueValues = colFilter.getUniqueValues();
        }
    

    to store the uniqueValues and then reverse the process on reconsitution?

    Or is there a better way? I am concerned about how much data I might be storing for columns with a lot of unique rows.

  • Posted 6 June 2022, 2:10 pm EST

    Hi,

    By default, the FlexGridFilter shows all the unique values for the column up to 250 which is the default max value for the column.

    It can be changed using the following code snippet:

    filter.getColumnFilter("ID").valueFilter.maxValues
    

    Further, you need not to set the UniqueValues until you are not setting them specifically using the following code snippet:

    filter.getColumnFilter("ID").valueFilter.uniqueValues = [3, 5, 7, 9];
    

    If you are setting the values, you would have fetched them from some API or other method, and in this case, you just need to set the values again when the filter is reset.

    Hope it clears!

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels