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

Using the data Vue Object in columns shows different results

5 Answers 94 Views
This is a migrated thread and some comments may be shown as answers.
Marius
Top achievements
Rank 1
Marius asked on 03 Sep 2018, 12:47 PM

This works

<kendo-grid :data-source="localDataSource" :columns="columnsTest[1]"></kendo-grid>

 

Vue:

columnsTest: [

    [{

'field': id
'title: 'ID'

    }],

[{
'field': id
'title: 'ID'
    }]

]

 

This does not work
<kendo-grid :data-source="localDataSource" :columns="columns"></kendo-grid>

Vue:
columns: [
    {
'field': id
'title: 'ID'
    },

   {
'field': product
'title: 'Product'
    }
]

 

I just check if the object has a title and copy the objects from the  array to a new array, columns.

but the title is not shown, just the table name as if a never used   on the grid.

Any tips? The reason for this is to only show columns that have a title from the backend.

 

 

 

5 Answers, 1 is accepted

Sort by
0
Sebastiaan
Top achievements
Rank 1
answered on 05 Sep 2018, 09:25 AM
Can you show the whole code of the Vue component? pseudo-code isn't enough to pinpoint the problem here
0
Accepted
Dimitar
Telerik team
answered on 05 Sep 2018, 10:00 AM
Hello Marius,

On the following StackBlitz example you can find a simple Grid implementation, where the column configuration is defined through the :columns prop as shown in the provided code snippet. With it, the respective columns are being correctly rendered when the Grid component is initialized.

Also, could you please confirm if you are able to reproduce the issue with the above example? If this is the case, please elaborate a bit more on what is the expected result and modify the linked example if needed.

In addition to the above, I would also suggest to take a look at the newly added Grid Column demos, where different configuration scenarios are being demonstrated:


Regards,
Dimitar
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Marius
Top achievements
Rank 1
answered on 05 Sep 2018, 12:35 PM

Thank Dimitar

The code example helped, not sure what was wrong, but rewrote it and it worked.

0
kuku
Top achievements
Rank 1
answered on 01 Mar 2020, 03:24 AM

I wanted to know the same thing?

Did you find answer

Regards

Kuku

Editor

door feeder

0
Dimitar
Telerik team
answered on 02 Mar 2020, 09:05 AM

Hello Kuku,

Could you elaborate further on what is the exact issue that you are facing? Also, it would be of great help if you could provide a StackBlitz example where the Grid configuration used can be examined.

Regards,
Dimitar
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Marius
Top achievements
Rank 1
Answers by
Sebastiaan
Top achievements
Rank 1
Dimitar
Telerik team
Marius
Top achievements
Rank 1
kuku
Top achievements
Rank 1
Share this question
or