javascript - How to populate koGrid Groups Array on initial load? -
how can populate kogrid
groups array? last line of following code throwing 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'] // code throwing error. without line working fine. }
can explain wrong?
Comments
Post a Comment