Hey Syncfusion Team,
Syncfusion spreadsheet supports a list of keyboard shortcuts listed here:
https://help.syncfusion.com/angular/spreadsheet/keyboard-shortcuts
I want to disable some of them ( not all of them ). Is there any integrated method in syncfusion for this?
Thank you.
Regards,
Vivek Singhal
|
created() {
this.spreadsheetObj.element.addEventListener(
'keydown',
(e) => {
if (e.keyCode === 86) {
// prevent ctrl+ v action
e.stopImmediatePropagation();
}
},
true
);
}
|
Hi Sangeetha,
Thanks for the response. I checked the demo and its working perfectly fine as intended.
Below are the shortcuts I want to ALLOW
Please try to implement below two as well if possible:
|
created() {
this.spreadsheetObj.cellFormat({ fontWeight: 'bold' }, 'E31:F31');
this.spreadsheetObj.cellFormat({ textAlign: 'right' }, 'E31');
this.spreadsheetObj.numberFormat('$#,##0.00', 'F2:F31');
this.spreadsheetObj.element.addEventListener(
'keydown',
(e) => {
if (
e.ctrlKey &&
(e.keyCode == 86 ||
e.keyCode == 67 ||
e.keyCode == 83 ||
e.keyCode == 88 ||
e.keyCode == 90 ||
e.keyCode == 17 ||
e.keyCode == 89)
) {
return; // keyboard shortcuts that need to work in your end
} else if (
e.ctrlKey &&
(e.keyCode === 66 ||
e.keyCode === 73 ||
e.keyCode === 85 ||
e.keyCode === 53 ||
e.keyCode === 70 ||
e.keyCode === 71 ||
e.keyCode === 75 ||
e.keyCode === 79 ||
e.keyCode === 72)
) {
// prevent other Keyboard shortcut action
e.stopImmediatePropagation();
}
},
true
);
}
|
Hello Sangeetha,
Thanks for the help. It worked as per requirements.
Regards,
Vivek Singhal