Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
500
Grid filtering on combo column using formatter
posted

Hi there,

A column of our grid is a combo, it stores integer value, but display text value using column formatter. When filter is enabled, it only allows entering integer value in the filter box, instead of text that is used for displaying. How grid can filtering on display text instead? I read a related post that demos Excel-style filter using customize dropdown with column available value and checkbox. But in my case, I still like to use grid out-of-box standard text filter rather picking available values.

Attached is the sample I use, the last column "Category" is a combo that stores integer value CategoryID, but displays Category Name, a string value, in the grid using column formatter. 

Thanks,

Michael

GridCombo.zip
Parents
No Data
Reply
  • 23953
    Verified Answer
    Offline posted

    Hello,

    You observe this behavior, because sorting, filtering and paging are implemented in the igDataSource, while the formatting and templating logic is implemented in the igGrid. When you use formatter function to lookup a column value the underlying igDataSource used by igGrid doesn't know about this, thus the problem with sorting and filtering.

    In order to filter and sort correctly, there is a need for igDataSource to know the actual value shown in the grid. This can be achieved with an unbound column which will hold the lookup value, while the actual *ID column will be hidden and will be updated programmatically.

    I've attached a sample which demonstrates how to use unbound column in order to support local sorting and filtering of lookup values. However this solution will work only for local sorting and filtering, because filtering and sorting for remote unbound column is not supported.

     

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc.

    igGridFiltering_lookupFilter.zip
Children