|
<ejs-grid #grid [dataSource]='data' [editSettings]='editSettings' [toolbar]='toolbar' (keyPressed)="keyPressed($event)" allowPaging='true'
(cellSave)='celsave($event)' (cellSaved)='celsaved($event)' >
.
.
public isKeyPressed = false;
public isCellSave = false;
ngOnInit(): void {
this.data = data;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Batch' };
this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
}
celsave(args){
this.grid.editSettings.showConfirmDialog=false;
this.grid.editModule.batchSave();
this.isCellSave = true;
}
keyPressed(args) {
this.isKeyPressed = (args.key == "Enter");
}
celsaved(args){
debugger
if(this.isKeyPressed && this.isCellSave){
this.grid.editModule.batchSave();
args.cancel = true;
}
else{
this.isKeyPressed = false;
}
}
|
|
App.component.ts
dataBound(args) {
if (this.flag) {
this.grid.keyboardModule.keyConfigs["enter"] = "";
this.grid.keyboardModule.keyConfigs["tab"] = "";
this.grid.keyboardModule.keyConfigs["shiftTab"] = "";
this.flag = false; // similarly you can handle the same for enter+tab key
}
}
public keyHandler(e) {
if (
(e.keyCode === 13 ||
e.keyCode === 9 ||
(e.keyCode === 16 && e.key === "Shift")) &&
e.target.classList.contains("e-rowcell")
) {
let rowInfo = this.grid.getRowInfo(e.target);
this.grid.editCell(rowInfo.rowIndex, (rowInfo.column as any).field);
}
}
} |
|
App.component.ts
dataBound(args) {
if (this.flag) {
this.grid.keyboardModule.keyConfigs["enter"] = "";
this.grid.keyboardModule.keyConfigs["tab"] = "";
this.grid.keyboardModule.keyConfigs["shiftTab"] = "";
this.grid.keyboardModule.keyConfigs["escape"] = ""; // remove the default behavior for escape
this.flag = false;
}
}
public keyHandler(e) {
if (
(e.keyCode === 13 ||
e.keyCode === 9 ||
(e.keyCode === 16 && e.key === "Shift")) &&
e.target.classList.contains("e-rowcell")
) {
let rowInfo = this.grid.getRowInfo(e.target);
this.grid.editCell(rowInfo.rowIndex, (rowInfo.column as any).field);
}
if (e.keyCode === 27 && e.key === "Escape" && this.grid.isEdit) {
this.grid.closeEdit(); // cancel the editing.
}
} |
Syncfusion has a very good component palette with many features. But in this important aspect, ejs grid is way behind competitors.
Please check how easy is it so modify cell values in as grid: https://www.ag-grid.com/example/. I've attached a small video.
You can move around in cells with arrow keys and immediately enter values. And safe using Enter. It's fast, intuitive and comfortable.
It would be very nice if ejs grid had a simmilar mode without "hacks"
Hi ,
In the EJ2 Syncfusion Grid, the Batch Editing mode provides functionality similar to what is demonstrated in the video you shared. This mode allows users to perform editing actions directly using the keyboard for an efficient and seamless experience.
Sample: https://stackblitz.com/edit/angular-xeakce8z?file=src%2Fapp.component.html
In this sample, the grid is configured with columns that replicate the structure shown in the video. Below are the key keyboard shortcuts for editing and navigating cells in the grid:
• F2 Key: Press F2 to enter edit mode for the currently focused cell.
• Tab Key: Use the Tab key to move to and edit the next cell in the row.
• Shift + Tab Key: Use Shift + Tab to move to and edit the previous cell in the row.
• Alt + Down Arrow: Press Alt + Down Arrow while in edit mode to open popups such as dropdown lists or date pickers.
• Escape Key: Press Escape to exit edit mode for the current cell.
• Enter Key: Use the Enter key to navigate to and edit cells in the row below
We have attached a video demonstrating the Batch Editing feature with full keyboard accessibility for reference.
Video:
For further details, we have attached the documentation on Keyboard Accessibility, which provides a comprehensive list of actions and their corresponding keys. We have also attached the Batch Editing documentation for your reference.
Key Board Accessibility: https://helpej2.syncfusion.com/angular/documentation/grid/accessibility#keyboard-interaction
Batch Editing: https://helpej2.syncfusion.com/angular/documentation/grid/editing/batch-editing
If you have any further queries regarding this please get back to us.
Regards,
Dineshnarasimman M
Hello Dineshnarasimman
I'm aware of batch editing. But it's not exactly what I'm wishing of. I still require the user to enter a row, start editing and then commit using "Update".
This sample is more the user experience we prefer:
But this still is only included in batch mode. So it comes with "green cells" and the need of hit the "update" Button.
Also, I think a cell edit mode should be included in the grid without writing additional code like in the sample above.
Thanks for considering our request
Francois
Hi,
We understand your requirement regarding the single click edit in the batch edit mode. Currently we do not have support for this requirement, however we have considered this as feature request from our end "Feature on single click editing in batch editing" and added it to our feature request database. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technical feasibility, and customer interest. And this feature will be included in any of our upcoming releases.
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
Feedback link: https://www.syncfusion.com/feedback/64275/feature-on-single-click-editing-in-batch-editing
We are closing this ticket for now. You can communicate with us regarding the open features at any time using the above Feature Report page.
Regards,
Dineshnarasimman M