Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Grid property featuresList always undefined
posted

Hi,

at the moment I am working on a big project based on Angular 2. Therefore I am using the igniteui-angular2 component extension to be found here https://github.com/IgniteUI/igniteui-angular2

The Problem: I try to manually (by clicking a button) show the popover for the ColumnChooser feature of the UI-Grid.
The way I am trying to achieve this is exactly the way it is described in the GettingStarted section of the Github repo I mentioned earlier.
But if I click the button I only get the following error in browser-console: "Cannot read property 'hiding' of undefined".

Fact is, that if I do a console.log() of my whole grid I can see that all my options have been added to it correctly, including the features. But only the "featuresList" property is set to undefined. Where is the mistake I am doing?

-------------------------------------------------------------

template.html:

<button (click)="openGridConfig"></button>
<ig-grid #grid1 [options]="gridOptions"></ig-grid>

-------------------------------------------------------------

component.ts

private gridOptions: IgGrid;
@ViewChild("grid1") myGrid: IgGridComponent;
.
.
.
constructor(...) {
     this.createGridSettings();
}
.
.
.
openGridConfig() {
     this.myGrid.featuresList.hiding.showColumnChooser;
}

createGridSettings() {
     this.gridOptions = {
          autoCommit: true,
          dataSource: this.searchResult,
          autofitLastColumn: false,
          autoGenerateColumns: true,
          columns: [
               ...
          ],
          features: [
               { name: "Sorting" },
               { name: "Resizing" },
               { name: "Hiding" }
          ],
     };
}

-------------------------------------------------------------


Regards,
Markus

Parents Reply Children