How to dynamically draw a wrapper grid using v-for

1 Answer 98 Views
Grid wrapper
HoCheol
Top achievements
Rank 1
HoCheol asked on 17 Jan 2024, 07:01 AM

I can't get v-for to work. is there any way to dynamically draw a GridColumn with a columnList?

Here is the code that I failed with

 

<Grid :data-source="tableData"
:selectable="'multiple cell'">
<GridColumn v-for="column in columns" :key="column.field" :field="column.field" :title="column.title" />
</Grid>

 

<Grid :data-source="tableData"
:selectable="'multiple cell'">
<template v-for="column in columns" :key="column.field">
<GridColumn :field="column.field" :title="column.title" />
</template>
</Grid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 17 Jan 2024, 09:43 AM

Hi HoCheol,

Using "v-for" will not be possible for defining the columns, but you can use the "columns" property directly:

Hope this helps. 

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources

Tags
Grid wrapper
Asked by
HoCheol
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or