This is a migrated thread and some comments may be shown as answers.

hideColumn() is not a function - AngularJS + TypeScript

2 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 03 Nov 2015, 08:33 PM

I have  a grid where I want to be able to hide some columns on first page load, a default view.  I have seen all the examples on the samples site and they are all in jquery. We are using AngularJS in TypeScript. In the attached zip file you will see a simplified version of the grid where I'm just attempting to follow the examples on your site and I keep getting the 'hideColumns()' is not a function.

 Thanks for any input on this issue!

 Mike

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 05 Nov 2015, 04:11 PM

Hello Michael,

 

The issue in your application is not related to Kendo UI. If you debug the `hideColumnClick` handler you will notice that `GridController hideColumns` method is not properly accessed and not executed at all.

 

Here is how you could change in order to execute properly:

 

`this.$scope.hideColumnClick = (event) => this.hideColumns();`. Now when the user click on the button second column in the grid will hide.

 

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 06 Nov 2015, 07:41 PM

Ok, so that pointed me in the right direction but wasn't quite the solution. We have a large SPA that has multiple controllers and this got all confused. I'm attaching the sample project that will actually hide columns.

 Hopefully it will help someone!

 

Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or