-1

I am not able to make checkboxes in angular-grid in angularjs and i have used celltemplate but its not binding with my controller I have tried in my controller:

"cellTemplate":'<input type="checkbox"  ng-model="row.isSelected" ng-click=" $scope.gridOptions.selectRow($event,row)">

I am using angular-grid

Harshit
  • 11
  • 1

2 Answers2

0

This is how we have achieved putting a checkbox inside of a ui-grid:

Need to use a template in the column. I have included an ng-click, which needs extra handling

 $scope.gridOptions = {
      data: $scope.yourData,
      columnDefs: [
            {
                field: "selected",
  cellTemplate: "
  <div class=\"ui-grid-cell-contents\">
     <span ng-cell-text>
        <input type=\"checkbox\" ng-model=\"row.entity.selected\" 
          ng-disabled=\"row.entity.checkBoxDisabled\" 
          ng-click=\"$event.stopPropagation();grid.appScope.hasChanged()\">
       </span>
   </div>
  "
}

ui-grid appscope

Mike
  • 1,645
  • 3
  • 13
  • 21
0

write input field inside div

cellTemplate: '<div><input  type="checkbox" ng-click="grid.appScope.selectRow($event,row)"/></div>'
Vicky Kumar
  • 1,358
  • 1
  • 14
  • 26