new Vue({
el: '#app',
template: `
<div id="app">
<ejs-grid id="Grid" ref="grid" :dataSource="data" :selectionSettings="selection" :toolbar='toolbar' :toolbarClick='clickHandler' height='315px'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' isPrimaryKey='true' textAlign='Right' width=90></e-column>
. . .
</e-columns>
</ejs-grid>
</div>
`,
data() {
return {
data: data.slice(0,20),
selection:{type:'Multiple'},
toolbar: [{ text: 'Row Info', tooltipText: 'Row Info', id: 'rowinfo' }],
};
},
methods: {
clickHandler: function(args) {
if (args.item.id === 'rowinfo') {
console.log(this.$refs.grid.ej2Instances.getSelectedRows());
console.log(this.$refs.grid.ej2Instances.getSelectedRecords());
}
}
},
provide: {
grid: [Toolbar,Page]
}
}); |