<ejs-listview id='sample-list-flat' [dataSource]='data' (keydown)="keydown($event)"></ejs-listview>
keydown(event) {
event.stopImmediatePropagation();
}
|
<style>
.e-listview .e-list-item.e-active {
background-color: blue;
}
</style>
|
Hai,
How to disable delete key(keyboard) in treegrid(angular)?
I tried with :
1.event.stopImmediatePropagation();
2.event.preventDefault();
3. (or simply) return false;
nothing had worked as expected.
Regards
Rama.
App.Component.html:-
<ejs-treegrid
#treegrid
[dataSource]="data"
height="400"
childMapping="subtasks"
[treeColumnIndex]="1"
[editSettings]="editSettings"
[toolbar]="toolbar"
(dataBound)="dataBound($event)"
>
<e-columns>
<e-column
field="taskID"
headerText="Task ID"
isPrimaryKey="true"
width="90"
textAlign="Right"
[validationRules]="taskidrules"
></e-column>
. . .
</e-columns>
</ejs-treegrid>
App.component.ts
dataBound(args) {
if (this.flag) {
// Removing key configuration for delete key
this.treegrid.grid.keyboardModule.keyConfigs['delete'] = '';
this.flag = false;
}
} |
Hai Farveen sulthana T ,
The given solution worked perfectly. The issue has been resolved. Thank you for your help.
Regards
Rama