Posted 11 November 2019, 2:42 am EST
Hi,
is there a way to enable cutting (with CTRL + X) in the FlexGrid, the same way i can copy by CTRL + C?
Regards
Forums Home / Wijmo / General Discussion
Posted by: bozjator on 11 November 2019, 2:42 am EST
Posted 11 November 2019, 2:42 am EST
Hi,
is there a way to enable cutting (with CTRL + X) in the FlexGrid, the same way i can copy by CTRL + C?
Regards
Posted 12 November 2019, 6:21 pm EST
Hi,
You will need to handle the ‘keyup’ event of the FlexGrid and then cut the data from the FlexGrid:
grid.hostElement.addEventListener('keyup', function(e) {
if(e.ctrlKey && e.key === 'x') {
const data = grid.getClipString();
wjcCore.Clipboard.copy(data);
grid.setClipString('');
}
}, true)
You may refer to the sample link below:
https://stackblitz.com/edit/js-brssdp
Please note that if a column is required (number and date types column are required by default), then the data of that column will not be removed from the FlexGrid.
Regards,
Ashwin