grid.data.events.on(“change”, function(id,status,updatedItem){
console.log(“An item is updated”);
});
Complete grid loading and event registration in the DOMContentLoaded event.
Then open the page link in the new tab, observe the output, it is valid, and this page is page a.
Then switch to another tab and reload page A when it is not the current page. In the output of page A, you will see that the event trigger was unsuccessful.
I found the reason during the review and placed the event registration in the following method. So it failed.
dhx.awaitRedraw().then(function() {
})
Hello @liudian,
I tried to reproduce the described issue (both ways with attaching listener inside and outside awaitRedraw
call) with following steps:
Opening page with grid => opening another page => reloading page with grid => reopen page with grid
But the change
event fired correctly on both cases.
It’s hard to suppose what exactly goes wrong, so it may be helpful if you provide more details on how to reproduce the issue, or reproduce it in the snippet below:
https://snippet.dhtmlx.com/9suo6yzy
(open the snippet => reproduce the issue => click the “Save” button => send me the new link)?
Kind regards,