I wanted to report some behavior, which I believe may represent bugs with how the treegrid control is working and I'm hoping you might have a workaround to help get things working for me.
Issue 1) When I add a row with parameters clicking the escape key to cancel no longer works.
a) Call add record with parameters
b) wait until the grid refreshes twice then call select row
c) on the select row event call start edit
The row is added and focus is set, but when I hit the escape key I cannot cancel out of the edit. You can see this by clicking add child on the 2nd add child button down in the demo.
Is there an event that fires after the selected event that might work better to call StartEdit and avoid this issue?
Issue 2) When I add a row with parameters the enter key does not work to save the row.
You can see this by clicking on the add child ideal button in the demo.
Issue 3) This is more of a suggestion, but when you add record, the add event does not get fired, instead the refresh event gets fired twice. it would be nice if it was consistent across calls.
Query1: Issue 1) When I add a row with parameters clicking the escape key to cancel no longer works. |
We checked your shared sample and video demo, and we were able to reproduce the issue at our end in the shared sample. On further validation, the first parameter of the add record method you pass is not an object value. So, this issue occurred, and the refresh method was called twice. To avoid this problem, we recommend passing the object value. If you pass an object value to the add record method, the actionComplete method will trigger the request type "save." You use the startEdit method in the actionComplete event, with the requesttype as "save."
Please refer to the below code snippet,
| |
Query2: Issue 2) When I add a row with parameters the enter key does not work to save the row. | ||
Issue 3) This is more of a suggestion, but when you add record, the add event does not get fired, instead the refresh event gets fired twice. it would be nice if it was consistent across calls. |
We suspect that the reported issue occurred, when the first parameter of add record method is not a object value.By default, while adding the record, in actionComplete event, trigger the args.requestType as “save”. |
Hi Pon,
Thank you for the workaround. It seems that if I pass in an empty array for children:[] it still refreshes twice and this is what is triggering the behavior. I don't believe I need to do this for the current use case and I believe the workaround will work for me.
This does not work:
|
public onActionComplete(args) {
console.log(args.requestType);
if (args.requestType == 'refresh') {
……
}
if (args.requestType === "beginEdit" || args.requestType === "add") {
}
if (this.secondTime) {
args.requestType = 'beginEdit';
}
|