[CLOSED] Making a call synchronous

  1. #1

    [CLOSED] Making a call synchronous

    Guys

    If there a way to make a function callback syncronous, something like

    
            MyApp.direct.ctlJobStati.GetProgress(1584, {
    
                success: function (result) {
    
                    if (result == '-1') {
                        value = value + " (?)";
                    }
                    else {
                        value = value + " " + result + "%";
                    }
                }
    
            }, WAIT);
    I know in jQuery you can use something like $.ajax {,,,,,, async:false }

    In this case I am rendering a grid and need to wait for the return from a WCF call to render a certain column. Non critical though as I do not like this implementation and will probably end up calling the WCF service from server side code and pre-populating the grid store.

    Ta,
    D
    Last edited by Daniil; Oct 24, 2014 at 5:38 AM. Reason: [CLOSED]
  2. #2
    Hi @CanopiusApplications,

    It might look like that.
    App.direct.TestDirectMethod('test', {
        async: false,
        success: function (result) {
            alert("The DirectMethod is done.");
        }
    });
    or
    App.direct.SomeDirectMethod('some parameter', {
        async: false
    });
    alert("The DirectMethod is done.");
    Though, I would want to ask the same.
    http://forums.ext.net/showthread.php...l=1#post174121
  3. #3
    Hi D

    Thanks -- I did work it out in the end myself once I started to use my brain ;-).

    Ok the reason for this is we have a grid and in one of the columns render event we get another value from a wcf service and depending on the result here we apply some formatting to the column using the returned result and hence the need to it to be synchronous. Now the obvious question is then wtf are not calling the service from the server and pre-populating the grid with what you need and then formatting -- well the short answer is because I was being a bit of an idiot and hence my earlier post stating "I am not a fan of this implementation" so this post was ultimately more out of curiosity than anything else.

    Another thing when searching the forums your link did not come up in the search results for some reason (unless I missed it).

    Ta,
    D
  4. #4
    Thank for the explanation:)

    Another thing when searching the forums your link did not come up in the search results for some reason (unless I missed it).
    Well, it happens.

    Sometimes I mark the threads with tags. Before searching I remind that I marked some thread regarding to synchronous AJAX. So, I type "sync..." in the tag search field here and saw the list of possible tags.
    http://forums.ext.net/search.php

    I ended up with the "synchronous AJAX" tag and found the thread that I wanted to find.

    By the way, if search via Google with the "synchronous AJAX" request, that thread goes first:)

Similar Threads

  1. [CLOSED] Making one row in gridpanel always editable
    By jchau in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 27, 2014, 5:01 AM
  2. [CLOSED] Ext.Msg.confirm, making it synchronous
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 25, 2014, 7:23 AM
  3. Replies: 1
    Last Post: Jun 05, 2013, 11:01 AM
  4. Synchronous DirectMethod?
    By glenh in forum 1.x Help
    Replies: 1
    Last Post: Sep 14, 2010, 5:11 AM
  5. Replies: 0
    Last Post: Feb 17, 2010, 12:25 PM

Posting Permissions