Sridhar Sridhar - 1 month ago 17
AngularJS Question

ui grid Filter and sorting not working when cellTemplate used

I am using

ui.grid
where some of the columns are populated with
cellTemplate
. It populates the value correctly, but the sorting and filtering is not working. Do I need to do anything with the sorting/filtering logic ?

Issue is recreated @ Plnkr http://plnkr.co/edit/JscrG3EJiTlnVa0t9DjH , both Age and Balance columns sorting and filtering is not working.

this.grdColDefs = [
{
name: 'Age',
width: 90,
cellTemplate: '<div class="ui-grid-cell-contents">{{grid.appScope.calcAge(row.entity)}}</div>',
headerCellClass: 'my-cell-header',
}
];

Answer

Issue resolved when I use field to point to the model.

Comments