Hello there.
I'm using SfGrid with Edit Dialog Template and inside a SfTab.
When I double click a row it opens the edit dialog fine just the first time. If I close the dialog and repeat the double click action it shows the error "Event is already tracked" and the dialog doesn't display well, it duplicates the data and crashes.
I put a breakpoint on the OnActionBegin event to see what was happening and it turns out that everything works fine thanks to the breakpoint pause. It gives the time to render or refresh something and somewhere and display the edit dialog correctly.
The same thing happens whit the DetailTemplate whit Tabs inside. The first time I open the row detail works well, but the second time it duplicates the data.
Again, I put a breakpoint on the DetailDataBound event and the pause makes everything works fine.
I tried adding a Task.Delay() and a Task.Yield() in the OnActionBegin event or the
DetailDataBound event, but is not working. I know i need that pause somwhere but I don't know where or how to put it.
Can you please help me or tell me what am I doing wrong ?
Thanks in advance.
Hi.
I kind of solve my problem with this javascript function.
function removeRepeatedActiveTab() {
setTimeout(function () {
const detailsPanels = document.getElementsByClassName("e-detailcell");
Array.from(detailsPanels).forEach((el) => {
const isRepeated = el.getElementsByClassName("e-item e-active").length > 1
if (isRepeated) {
const el_rep = el.getElementsByClassName("e-item e-active")[0];
el_rep.parentElement.removeChild(el_rep);
}
});
}, 500);
}
Anyway, I send you my code to see if there's something wrong.
Thank you.
Well... I really want to know why is this happening ? Because my "solution" is just a patch. It's not solving the real problem.
This also happens when opening a second row detail, not only the same row detail.
So, could you please try to replicate this issue and tell me if there's a solution?
Thank you in advance.