Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by bonjo on May 30, 2007 18:49
open dhtmlx forum
Cancel loading of xml at dthmlxgrid

Is it possible to cancel or abort the xml loading of a dhtmlxgrid at it's setOnLoadingStart() function handler?

Hope for your reponse..

rgds,
bonjo
Answer posted on May 30, 2007 19:19
The setOnLoadingStart is only informative event, it can't block the loading of XML ( in most cases blocking the xml loading can cause inner state corruption )
Answer posted by Lennart on Jan 18, 2008 16:53
Is this answer still valid? And is it the same for the dhtmlx-tree?

Because I am loading a tree depending on some context. And as the loading can take quite a while I want to have the option to alter that context, which makes the tree smaller. But as long as there is no way to cancel the first loading, there would be no advantage in speed! Maybe some very simple, not-dhtmlx-related solution (as every browser is able to cancel a request)?
Answer posted by Support on Jan 21, 2008 04:27
Yes, the onXLS event is informative only, and can't be used for blocking data loading.

>>But as long as there is no way to cancel the first loading
You can access last created request object as
    grid.xmlLoader.xmlDoc
and block the current load as
    var t=grid.xmlLoader.xmlDoc.onreadystatechange;
    grid.xmlLoader.xmlDoc.onreadystatechange=function(){}
    grid.xmlLoader.xmlDoc.abort();
    grid.xmlLoader.xmlDoc.onreadystatechange=t;


The same must work for dhtmlxtree as well.
Please beware that in case of dynamical loading mode, there may be multiple active loaders in same time, described code allows to access only latest one.
   
   
Answer posted on Jan 21, 2008 13:52
>> var t=grid.xmlLoader.xmlDoc.onreadystatechange;

Produces an "Permission denied to create wrapper for object of class UnnamedClass" exception in Firefox... which seems (!) to be a security restriction of FF - didn't find a workaround... I don't really need to (re-)store the current onreadystatechange, though, but the solution would be interesting

>> grid.xmlLoader.xmlDoc.abort();

OK, thanks. A thing I wasn't aware of, as a note for the next user: At least as far as I understand (and it makes sense), this abort doesn't stop the server from executing the request, it just prevents the returned result to be executed by the client. So you don't save the server's processing-time
Answer posted by sematik (Support) on Nov 29, 2014 05:04

To find more precise comments upon this issue, we can offer you read about ajax calendar scheduler and rich web applications.