-
15 Mar 2010 4:53 AM #41Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
1. Use the following line to disable invalid drop animation:
2. Return false from beforenodedrop and do your Ajax request (optionally show some kind of waiting indicator).Code:treePanel.dragZone.proxy.animRepair = false;
3. When the response is received, move the node in code.
-
15 Mar 2010 5:01 AM #42
Great thanks, Condor.
I've decided this issue in similar but static way:
Ext.dd.StatusProxy.prototype.animRepair = false;
PS Wouldn't you explain also how can problem with renaming nodes be resolved in more correct way?
-
15 Mar 2010 6:05 AM #43
-
15 Mar 2010 6:24 AM #44
-
15 Mar 2010 6:53 AM #45Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
-
25 May 2010 9:31 AM #46
How about this: Minimalistic / Least Invasive Surgery. Rather than cut a scar across your gut to take out an appendix, make a small incision and use some tweazers and a fiber optic camera and a lazer to remove it.
So your tieing into a framework that was already done synchronously and you don't want to spend the time or money to re-write things. The client you are working with wants to see the job done ASAP, they are on a shoe string budget.
You want to use a package such as Joomla and VirtueMart on your E-Commerce Site.
You need to validate input against a database.
You want to do bare-minimal code tweaks so as to sniper the specific validation issue rather than re-write the whole validation function to work asynchronously.
You just want to insert a few lines of code in dynamically generated javascript from PHP code.
// Up here's a bunch of virtuemart/joomla dynamic javascript stuff, perhaps regular expression to make sure there are no
// blank fields, etc.. You don't want to tug on this ball of spaghetti....because the fields are dynamically generated from a database // of fields and rules.
// Synchronous call right here baby to not disturb the rest of the system. I don't want to re-route arteries, quadroople bypass, zombie anesthesia.
// Put a timeout in there after 5 seconds it returns false; to stop the dreaded hang.
if (notGood(inputa,inputb)) {
alert('Failed DB Validation!');
return false; // stop the form.submit()
}
// If we get here, we will continue with the rest of the validation, submit
// Down here is a bunch of PHP joomla/virtuemart dynamically generated javascript code that I have no interest in re-writing or putting in a completion block because I would have to re-write the final form.submit() in the completion block.
So if I did this synchronously, I would have hack up the existing virtuemart/joomla code and I really really don't want to get into all that. I just want a simple function notGood()
-
9 Mar 2011 10:39 AM #47
Yes, see my app, a vey complicated genome-wdie association app using ExtJS, backend supporting data
are over tens or even hundreds of Gbyte.
http://www.ncbi.nlm.nih.gov/projects...1&to=191000001
before any asynch data querying , I need to grab query parameters, like genome build version, snp build version, chromosome length, etc that chage or update very often. Ajax asynch calls grab the jsons for all the analysis tracks (un limited), but a syn ch call come first to grab all asynch call's query parameters.
Use of the EXTJS ajax call w/ sync flag on/off will make design and coding and update analysis track loading order logically elegant.
mxu
mxu
-
10 Mar 2011 4:17 AM #48
this can be done using simple callback - what's wrong with callback? It does exactly what you want, a queue of actions which are done when prior task is finished.
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
10 Mar 2011 9:36 AM #49
the order of grabbing parameters before data and the order of data display change often, I use ajax call order w/
synch flag to achieve this. Implementation of callback won't do this unless I change codes evry time.
-
22 Aug 2011 12:15 PM #50
In case anyone still cares about synchronous calls
In case anyone still cares about synchronous calls
My main use case for this is in a before unload event. If you need to do something before the page is unloaded, it must be done synchronously. Once the page is unloaded, all JavaScript processing on that page is stopped. Therefore, if you start an AJAX request in the beforeunload handler, it is most likely that it will not get run before the browser window is destroyed.
In fact, I think this is one of the main reasons that the XMLHttpRequest specification supports a synchronous flag.


Reply With Quote