Search not working properly in grid with custom cell using ngFor
Description
Search not working properly in grid with custom cell using ngFor
- igniteui-angular version: 6.1.3
- browser: Chrome 68.0.3440.106
Steps to reproduce
- Open example: Sample
- Search "consumer" in main input of search
Result
In column IndustrySector in the first row the value of the cell is "--Consumer--Consumer"
Expected result
In column IndustrySector in the first row the value of the cell should be "Consumer"
Reference: #1931
Attachments
@lalo-mx My comment from the issue you have referenced explains exactly what is going on here, as well. The search currently has a limitation and it doesn't work properly with templates. Do you really need the this template? Virtually identical functionality can be achieved with simply using a column formatter and then the search will work well. If you need help to do this, please see this stackblitz sample.
@DDavidkov The problem I am trying to solve is when a column has a numerical value that is represented by a label, for example (The active state has value "1" and the label "Active", the value "0" and the label "Inactive"). This problem can be solved with a select but the grid does not support this type of columns. My idea to solve this problem was to have a template and filter the collection of states and only show the one that corresponds to the value of the cell.
I will test the column formatter option that you are suggesting.
@lalo-mx If I am understanding your use case correctly and you just want to have labels representing numbers in your data, you can definitely implement this by just using a column formatter. To do that add a switch case in your formatter that would switch on the numeric value and return the appropriate string for that number.