AngularJS ui网格编辑无法与组一起使用

时间:2015-05-20 07:05:04

标签: angularjs angular-ui-grid

我使用角度ui-grid,它工作正常,但是当我从选项应用分组时,编辑功能无效。

请检查plunker

var app = angular.module('app', ['ngTouch', 'ui.grid','ui.grid.edit', 'ui.grid.grouping', 'ui.grid.pinning','ui.grid.exporter','ui.grid.selection']);

app.controller('MainCtrl', ['$scope', 'uiGridConstants', function ($scope, uiGridConstants) {
  $scope.columns = [

    //Below line is with default groupby functionality (If we uncomment below line edit functionality on cell double click is not working)
    { field: 'GHC', grouping: { groupPriority: 1 }, pinnedLeft: true}, 
    //Below line is with without groupby functionality (If we comment above line and uncomment below line  edit functionality on cell double click is working as expected)
    //{ field: 'GHC',  pinnedLeft: true}, 

    { field: 'Status', filter: {
          type: uiGridConstants.filter.SELECT, 
          selectOptions: [ { value: 'Active', label: 'Active' }, { value: 'Won', label: 'Won' }, { value: 'Lost', label: 'Lost'}, { value: 'InActive', label: 'InActive' }]
        }
    },
    { field: 'Region' },
    { field: 'Country' },
    { field: 'City' },
    { field: 'Industry'},
    {  field: 'SubIndustry',displayName: 'SubIndustry' }, 
    { field: 'Date Of Win' }];
  $scope.gridOptions = {
    enableFiltering: true,
    exporterMenuCsv: true,
    enableGridMenu: true,
    exporterCsvFilename: 'myFile.csv',
    columnDefs: $scope.columns
  }
  $scope.gridOptions.data = data;
}]);

1 个答案:

答案 0 :(得分:1)

好的,我觉得问题是组头行不允许编辑。当网格首次渲染所有组都已折叠时,所以没有任何行可编辑。当您展开以显示一些细节行时,我们重用DOM,并且不会重新评估editable属性。简而言之,您发现了一个错误。我建议你提出一个问题,我可以将其视为我目前正在进行分组工作的一部分。