Hi, I am getting the same error. I think this error is displayed when the project's Target Framework is .net standard 2.1.
I am attaching a demo project where you can see the error while clicking once in the editable cell
|
<SfGrid ID="Grid" @ref="GridInstance" ...>
<GridEvents Created="Created" CellSelected="CellSelectHandler" TValue="Order"></GridEvents>
...
</SfGrid>
public async Task CellSelectHandler(CellSelectEventArgs<Order> args)
{
...
await Task.Yield();
await GridInstance.EditCell(CurrentEditRowIndex, fields[CurrentEditCellIndex]);
} [singleedit.js]
function singleedit() {
document.getElementById("Grid").addEventListener("click", function (e) {
if (e.target.tagName == "TD") {
e.target.blur();
}
});
}
|
Hi Thanks for the answer is working fine but sometimes when you click twice the grid break down, Console errors are fired
Unhandled exception rendering component: Event 1013 is already tracked
Error: Event 1013 is already tracked
You can reproduce it with the sample you attached.
I am adding a GIF
Hi
- I can still reproduce the error by double click an editable cell, I watched your demo video but I can't notice the double click.
The version is 19.1.0.69, The target framework is netstandard2.1
- Another thing is that with your suggested solution, using JS Interops and the OnCreate callback when you use the arrows hotkeys left and right the grid gets broken. You can reproduce this by select a non-editable cell and when press ->(right) hotkey to move to an editable cell the grid breaks down (noticed the Task.Yield is the method that causes the issue).
This does not happen when the suggested solution is not implemented(you can try this on the Counter razor page in the attached demo). I this case what happens is when you go from a non-editable to an editable cell with the right and left arrow hotkeys the edition gets enabled and then if you press the arrows the focus does not move to the left or right cell.
I think there should be a callback where I can notice which hotkey is pressed and if is an arrow, then close the edition and be able to navigate with arrows among editable and non-editable cells, right?
I am attaching gif's with demos and to reproduce both in the index and the second in counter razor pages
public async Task Created(){
await IJSRuntime.InvokeAsync<object>("singleedit");
}
...
public bool flag = false;
public string currentclickedcolumn{ get; set; }
public async Task OnRecordClick(RecordClickEventArgs<Order> args)
{
Console.WriteLine("OnRecordClick");
flag = true;
currentclickedcolumn = args.Column.Field;
}
public async Task RowSelected(RowSelectEventArgs<Order> args)
{
if (flag)
{
Console.WriteLine("RowSelected");
flag = false;
await GridInstance.EditCell(args.RowIndex, currentclickedcolumn);
await Task.Yield();
}
}
|