App.vue
<ejs-grid ref="grid" :dataSource="data" :dataBound="dataBound" :allowPaging="true" :pageSettings='pageOption' >
<e-columns>
<e-column v-for="(value, index) in headers" v-bind:key="index" :field='value.field' :headerText='value.headerText'
:type="value.type"></e-column>
</e-columns>
</ejs-grid>
export default Vue.extend({
methods:{
setData() {
. . .
},
dataBound : function () {
this.$refs.grid.aggregates = [{columns:[{field:'id',type:'sum',footerTemplate:this.sumTemplate}]}]
},
}
});
|
App.vue
onDataBound : function () {
this.$refs.grid.ej2Instances.setProperties({aggregates : [{columns:[{field:'id',type:'Sum',footerTemplate:this.sumTemplate}]}]})
}
|
App.vue
<ejs-grid ref="grid" :dataSource="data" :dataBound="onDataBound" >
<e-columns>
<e-column v-for="(value, index) in headers" v-bind:key="index" :field='value.field' :headerText='value.headerText' ></e-column>
</e-columns>
</ejs-grid>
. . .
onDataBound : function () {
// using setproperties to set aggregates dynamically
this.$refs.grid.ej2Instances.setProperties({aggregates : [{columns:[{field:'id',type:'Sum',footerTemplate:this.sumTemplate}]}]})
}
|