Strange behavior with Edit Dialog or Detail Template only works first time
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.
- Share the entire Grid code example along with dialog template component.
- If possible share simple issue reproducible sample.
- Kindly re-attach the screenshot with clarity, it will be very helpful for us to track down the issue.
- Also you have mentioned that pause in OnActionBegin event resolves the issue. we suspect that some actions gets initiated before another action is completed.
- Also ensure the reported issue by removing the contents of other tab. So that we can find issue occur dur to which component and which tab.
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.
Attachment: ejemplo_grid_syncfusion_b980bd61.zip
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.
- 5 Replies
- 2 Participants
-
JB Jennifer Benavides
- Nov 15, 2021 07:57 PM UTC
- Nov 29, 2021 11:28 AM UTC