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
Hi Markus,
I'm glad to hear that!
Hi Deyan,
I found out I was importing all my resources from a wrong Module. Works everything as it should now, THANK YOU!Have a nice day,Markus
I believe they are exported by the NgModule. Using them should be the same as ig-combo and ig-grid, can you attach a small sample demonstrating this behavior?
I tried declaring my features through the custom tags <features> and in my case <hiding>.Doing that, by rendering the app I get the error that those tags are unknown and can't be compiled. I then tried importing "Features" and "IgHidingFeatures" in my NgModule as well as directly in my NgComponent but that didn't solve the problem. So far I can actually work with tags like <ig-grid>, <ig-combo> and so on...
RegardsMarkus
Hello Markus,
If need further assistance please let us know.