Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144260 | Apr 27,2019 01:10 AM UTC | Aug 5,2019 12:29 PM UTC | Vue | 5 |
![]() |
Tags: Data Grid |
new Vue({
el: '#app',
template: `
<div id="app">
<ejs-grid id="Grid" ref="grid" :allowPaging='true' :recordDoubleClick="recordDoubleClick" :dataSource="data" height='315px'>
<e-columns>
. . .
</e-columns>
</ejs-grid>
</div>
`,
data() {
return {
data: data.slice(0,20),
};
},
methods: {
recordDoubleClick: function(e) {
// you can show Dialog component here
alert("dblclick");
console.log(e);
}
});
|
[App.Vue]
<template>
<div id="app">
<ejs-grid
id="Grid"
ref="grid"
:recordDoubleClick="recordDoubleClick"
:rowSelected="singleClick"
:dataSource="data"
:allowPaging="true"
>
. . . .
</ejs-grid>
</div>
</template>
<script>
. . . .
Vue.use(GridPlugin);
window["timer"] =0;
window["isDoubleClick"] = false;
export default {
data() {
return {
data: data
};
},
provide: {
grid: [Page]
},
methods: {
recordDoubleClick: function(args) {
isDoubleClick = true;
},
singleClick: function(args) {
window.clearTimeout(timer);
var timer = setTimeout(
function() {
if (isDoubleClick) {
// you code here while double click action
} else {
this.prevDataFn.call(); // Call the prevDataFn function while we do a single click
}
isDoubleClick = false;
}.bind(this),1000);
selectedRecords.push(args.data);
},
prevDataFn: function() {
// you code here while single click action
}
}
}; |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.