0
votes

I created a grid with column defs and showFilter. One column use cellTemplate to manipulate the output, based on value of that field.

When I try filter data, I notice that filter ignores that column.

How I filter all columns from grid, including the column that refers cellTemplate?

This is my grid:

$scope.gridStatusOptions = {
            data: 'status',
            showFilter: true,
            columnDefs: [{ field: 'name', displayName: 'Name', cellFilter: '', cellTemplate: '' },
                        { field: 'value', displayName: 'Value', cellFilter: '', cellTemplate: "<div class='ngCellText' ng-class='col.colIndex()'><span>{{formatState(row.entity)}}</span></div>"}]
};

Regards

1
Show us some of your code please. Especially the cellTemplate. And, since you are new here, take the TOUR in the HELP dropdown at the top of this page to find out how to properly as questions.mainguy
I added my grid to my question. Do you know a solution?bob

1 Answers

0
votes

Filters in ng-grid work on the underlying data and not what is rendered to the DOM of your browser.

This has to be so, because if your data is coming from the server it also has to be prefiltered, paginated and sorted on the server side.

If you don't have the (to be filtered) fields in the right format, do a transform on the data and add preformated fields.

Look at my answer here that I gave just a few days ago.

Btw: If you want to format the code in your question properly just select it and hit CTRL-K. Makes it more readable.