1. #41
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. Use the following line to disable invalid drop animation:
    Code:
    treePanel.dragZone.proxy.animRepair = false;
    2. Return false from beforenodedrop and do your Ajax request (optionally show some kind of waiting indicator).
    3. When the response is received, move the node in code.

  2. #42
    Ext User
    Join Date
    Jan 2010
    Posts
    18
    Vote Rating
    0
    csbubbles is on a distinguished road

      0  

    Default


    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?

  3. #43
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Quote Originally Posted by csbubbles View Post
    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?
    Unfortunately, there is no beforetextchange that you could use to stop the node text being changed.
    The easiest method is probably to override TreeEditor.updateNode to send a server request instead of changing the node text.

  4. #44
    Ext User
    Join Date
    Jan 2010
    Posts
    18
    Vote Rating
    0
    csbubbles is on a distinguished road

      0  

    Default


    Ok, thanks, I'll try this way.

  5. #45
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I created a feature request on the subject.

  6. #46
    Sencha User
    Join Date
    Apr 2010
    Location
    Arizona High Desert USA
    Posts
    14
    Vote Rating
    0
    UltimateCodeWarrior is an unknown quantity at this point

      0  

    Default


    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()

  7. #47
    Sencha User
    Join Date
    Oct 2007
    Posts
    447
    Vote Rating
    0
    mxu is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    Can anyone provide a use case for synchronous requests?
    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

  8. #48
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    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

  9. #49
    Sencha User
    Join Date
    Oct 2007
    Posts
    447
    Vote Rating
    0
    mxu is on a distinguished road

      0  

    Default


    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.

  10. #50
    Sencha User
    Join Date
    Aug 2011
    Posts
    2
    Vote Rating
    1
    brokenwren is on a distinguished road

      1  

    Default 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.