什么是UI-GRID的页眉单元模板?

时间:2019-07-12 07:57:20

标签: angularjs ui-grid

我创建了一个自定义复选框,选中该复选框后,我想选择整个ui网格行。目前,在选中复选框时,我只能选择ui网格的一列。

columnDefs: [
  {
    name: '',
    field: 'isChecked',
    width: '3%',
    cellTemplate: '<div  style="height:20px; "class="text-center" ><input type="checkbox" style="height:20px;width:15px; margin-top:5px;"  ng-model="row.entity.isChecked" ng-change="grid.appScope.rowSelectionChange(row.entity)" checked/></div>'
  },
  {
    field: 'name',
    displayName: 'Name',
    enableColumnMenu: false,
    allowCellFocus: false,
    enableSorting: true,
    enableCellEdit: false,
    width: '15%',
    cellTemplate: "<div  ng-class='{checked:row.entity.isChecked,unchecked:!row.entity.isChecked}' style ='margin-left:5px; margin-top:5px' title='{{row.entity.name}}'><a ng-click='grid.appScope.addViewUpdate(row.entity.id, false)'>{{row.entity.name}}</a></div>",
    cellTooltip: function(row) {
      return row.entity.name;
    }
  },
  {
    field: 'description',
    displayName: 'Description',
    enableColumnMenu: true,
    width: '25%',
    enableSorting: true,
    enableCellEdit: false
  },
  {
    field: 'dataSourceType',
    displayName: 'Type',
    enableColumnMenu: true,
    width: '8%',
    enableSorting: true,
    enableCellEdit: false,
  },
  {
    field: 'characterSet',
    displayName: 'File Character Set',
    enableColumnMenu: true,
    type: 'text',
    enableSorting: true,
    enableCellEdit: false,
  },
  //{ field: 'action', displayName: 'Actions', enableColumnMenu: false,  enableSorting: true, enableCellEdit: false, width: '25%', cellTemplate: "<div  style='margin-left: 7px;margin-top:4px;'><action-dropdown  source='grid.appScope.sourceData' action-element='row.entity'></action-dropdown></div>"},
],

0 个答案:

没有答案