Search code examples
angularjsangular-ui-grid

ui-grid angularjs checkbox button not being resorted


I have a checkbox column using ui-grid after I check one column and sort with another column for example age, the active column is not being resorted.

This is a plunkr of the problem

http://plnkr.co/edit/Q3Fs3XiRBpqkzKdZlGXW?p=preview


Solution

  • You have a problem with your cell template. You are not binding the value isActive to the checkbox.

    Change the checkbox column to this

    { 
    name: 'isActive', 
    displayName: 'Active', 
    type: 'boolean',
    cellTemplate: '<input type="checkbox" ng-model="row.entity.isActive">'
    }
    

    This plnkr works right. http://plnkr.co/edit/PL7HvK1FY2ycuOrBbBTA?p=preview