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

columns attribute resolved to undefined. Maybe you meant to use a string literal like: 'gridColumns'?

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 29 Jul 2015, 07:36 AM

Hi, I am plugging in KendoUI with AngularJS to a application we have. I have been able to get the GRID to work as in display data and be configured with various options like sort / group / select. 

However, the k-columns option does not appear to work at all.  The entire dataSource is being displayed in the GRID instead of just the columsn I want to see. 

This is what my element looks like on the page.  

        <kendo-grid options=kendo-grid
                    k-data-source="gridData"
                    k-columns="gridColumns"
                    k-selectable="true"
                    k-groupable="false"
                    k-sortable="true"
                    k-height="600"
                    k-on-change="selected = data">
        </kendo-grid>​

 

In the js file it looks like this.

    $scope.gridData = [
                    { artist: "Pink Floyd", track: "The dark side of the Moon", album: "1978" },
                    { artist: "The Beatles", track: "I've just seen a face", album: "moonwalk" },
                    { artist: "Queen", track: "Innuendo", album: "dasher" }
   ];

   $scope.gridColumns = [
                  { field: "artist", title: "Artist" }
   ];



 But the output is always always all of the data instead of just one column. See attachement. 

The console is reporting the following error. 

 >columns attribute resolved to undefined. Maybe you meant to use a string literal like: 'gridColumns'?

I have played around with this in the following demo, and it works fine here.

http://dojo.telerik.com/UqoBu

 

Our app is in VS2013. 

 ​

Im a bit stumped on where to go from here. 

 

thanks

Mark

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 30 Jul 2015, 01:31 PM
Hi Mark,

The k-*option-name* attributes should have the expected value instead of a reference to some scope property. If you prefer that approach, then I would suggest using the k-options attribute instead. Otherwise you can pass a JSON string for the k-columns attribute.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or