0

How can I populate a koGrid Groups Array? The last line of the following code is throwing an error:

gridOptions: {
        data: ko.observableArray([{ name: 'John', title: 'Abc', age: 29, salary: 35000, company: "OATI" }, { name: 'Peter', title: 'XYZ', age: 35, salary: 70000, company: "Infogain" }]),
        multiSelect: true,
        showGroupPanel: true,
        showColumnMenu: false,
        showFilter: false,
        columnsChanged: this.columnsChanged,
        maintainColumnRatios: true,
        enablePaging: true,
        pagingOptions: this.pagingOptions,
        hideChildren: false,
        footerVisible: false,

    displaySelectionCheckbox: false,
    columnWidth: 1000,
    columnDefs: ko.observableArray([
                                    { field: '_sortIndex', visible: false, displayName: "Random Sort", sortDirection: "asc" },
                                    { field: 'name', visible: true, displayName: "Name", selectable: true, groupIndex: 1, width: 150 },
                                    { field: 'title', visible: true, displayName: "Title", width: 150 },
                                    { field: 'age', visible: true, displayName: "Age", width: 150 },
                                    { field: 'salary', visible: true, displayName: "Salary", agg: "sum", width: 150 },
                                    { field: 'company', visible: true, displayName: "Company", width: '**' }
    ]),
    groups: ['company'] // this code is throwing error. without this line it is working fine.

}

Can anyone explain what is wrong?

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
Deepak Kumar
  • 648
  • 6
  • 14

0 Answers0