Posted 24 September 2020, 3:19 am EST
Hi
How can I dynamically create columns in the FlexGrid control?
It only works with initial value of 'columns ’
but failed when I tried to add columns by click the button.
wijmo version is 5.20172.359
<button @click="test">Insert New Column</button>
<wj-flex-grid :itemsSource="ds">
<wj-flex-grid-column
:col="col"
v-for="(col, index) in columns"
:key="index"
width="*"
:binding="col.binding"
:header="col.header"
>
</wj-flex-grid-column>
</wj-flex-grid>
import { Component, Vue, Watch } from 'vue-property-decorator'
@Component({
name: 'Demo',
components: { }
})
export default class extends Vue {
[x: string]: any
data() {
return {
columns: [
{ header: 'cartype', binding: 'cartype' },
{ header: 'doccode', binding: 'doccode' }
]
}
}
test() {
this.columns.push({ header: 'testid', binding: 'testid' })
}
}
wj-flex-grid-cell-template also dit not work here. I’m not sure if 'wj-flex-grid-cell-template ’ works .