|
<template>
<div id="app">
<ejs-grid
ref="grid"
:dataSource="data"
:editSettings="editSettings"
:created="created"
: recordClick=” recordClick”
height="273px"
>
<e-columns>
...
</ejs-grid>
</div>
</template>
<script>
Vue.use(GridPlugin);
let isskipe = false;
export default {
data() {
return {
data: data,
};
},
methods: {
recordClick: function (args) {
if (isskipe) {
isskipe = false;
}
},
created: function (args) {
var grid = document.getElementsByClassName("e-grid")[0].ej2_instances[0];
grid.focusModule.focus = function (e) {
this.parent.notify("virtaul-cell-focus", e);
grid.focusModule.removeFocus();
if (
e &&
e.key=== "Tab" &&
grid.getColumnByIndex(parseInt(e.target.getAttribute("aria-colindex"),10))
.field === "CustomerID"
) {
isskipe = true;
var a = grid.focusModule.getContent().getFocusInfo().element
.nextElementSibling;
if (a.getAttribute("aria-colindex") === "2") {
a = grid.focusModule.getContent().getFocusInfo().element
.nextElementSibling.nextElementSibling;
}
var newEle = {
element: a,
elementToFocus: a,
outline: true,
uid: a.parentElement.getAttribute("data-uid")
};
grid.focusModule.addFocus(newEle, e);
} else if (isskipe) {
var a;
if(parseInt(e.target.getAttribute("index"),10)===0){
a = grid.focusModule.getContent().getFocusInfo().element
.nextElementSibling;
}else{
a = grid.focusModule.getContent().getFocusInfo().element;
}
if (a == null) {
a = grid.focusModule.getContent().getFocusInfo().element.parentElement
.nextElementSibling.firstElementChild;
}
var newEle = {
element: a,
elementToFocus: a,
outline: true,
uid: a.parentElement.getAttribute("data-uid")
};
grid.focusModule.addFocus(newEle, e);
} else {
grid.focusModule.addFocus(
grid.focusModule.getContent().getFocusInfo(),
e
);
}
</script> |
|
<template>
<div id="app">
<ejs-grid
ref="grid"
:dataSource="data"
:editSettings="editSettings"
:created="load"
: recordClick=” recordClick”
height="273px"
>
<e-columns>
...
</ejs-grid>
</div>
</template>
<script>
Vue.use(GridPlugin);
let isskipe = false;
export default {
data() {
return {
data: data,
};
},
methods: {
recordClick: function (args) {
if (isskipe) {
isskipe = false;
}
},
load: function (args) {
var grid = document.getElementsByClassName("e-grid")[0].ej2_instances[0];
grid.focusModule.focus = function (e) {
this.parent.notify("virtaul-cell-focus", e);
grid.focusModule.removeFocus();
if (
e &&
e.key=== "Tab" &&
grid.getColumnByIndex(parseInt(e.target.getAttribute("aria-colindex"),10))
.field === "CustomerID"
) {
isskipe = true;
var a = grid.focusModule.getContent().getFocusInfo().element.parentElement.
.nextElementSibling.firstElementChild;
var newEle = {
element: a,
elementToFocus: a,
outline: true,
uid: a.parentElement.getAttribute("data-uid")
};
grid.focusModule.addFocus(newEle, e);
} else if (isskipe) {
var a;
if(parseInt(e.target.getAttribute("index"),10)===0){
a = grid.focusModule.getContent().getFocusInfo().element
.nextElementSibling;
}else{
a = grid.focusModule.getContent().getFocusInfo().element;
}
if (a == null) {
a = grid.focusModule.getContent().getFocusInfo().element.parentElement
.nextElementSibling.firstElementChild;
}
var newEle = {
element: a,
elementToFocus: a,
outline: true,
uid: a.parentElement.getAttribute("data-uid")
};
grid.focusModule.addFocus(newEle, e);
} else {
grid.focusModule.addFocus(
grid.focusModule.getContent().getFocusInfo(),
e
);
}
</script> |
My requirement is same but in angular but i want global solution for any tables having actionable columns that is if column having hyperlink or delete functionality. For example, a table with name having hyperlink then mobile no, dob which are non actionable columns then the last action column with delete particular row. In this i want tabbing only on actionable columns and prevent tabbing on non actionable columns.
Hi Ronit,
We have prepared a simple sample to skip the focus on a particular column in the Angular Grid. Please refer to the below sample in which e have skipped the focus while tabbing for the “OrderDate” column.
https://stackblitz.com/edit/angular-yvpvg5?file=app.component.ts
Please get back to us if you need further assistance on this.
Regards,
Pavithra S
Hi , hi am looking exactly in angular ejs grid ,I want skip non editable multiple cells , Ex: I have 5 columns 1st column cell is hyperlink/actionable rest 3 non actionable I want skip non actionable 3 cells , and 4th and 5the columns are actionable I want focus on actionable/ hyperlink , I want to apply this for multiple ejs grid for different screen so I need global solution for this
Hi Rocky,
Currently we are working on this query with your shared information, and we will update you the details on 18th APR 2022. Until then we appreciate your patience.
Rajapandi R
Hi Rocky,
Thanks for your patience.
We have prepared a simple Angular Grid sample in which we have used service to reuse the created event for multiple Grids. Please refer to the below sample for more information.
https://stackblitz.com/edit/angular-yknppm-bmstmt?file=async-grid.component.ts
Regards,
Pavithra S