1. #21
    Sencha User
    Join Date
    Mar 2009
    Location
    Fort Worth, TX
    Posts
    65
    Vote Rating
    -36
    jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts jemptymethod is infamous around these parts

      0  

    Default


    Quote Originally Posted by ryounes View Post
    A possible use case: in TreePanel.beforeNodeDrop(), I want to perform server-side rather than client-side validation of the drop so that the logic about valid drop locations doesn't have to reside in the client. beforeNodeDrop() must return false to stop the drop, but it returns without receiving a response from the server. The server response can only be captured in the callback, but from there you can't control what beforeNodeDrop() returns. Is there a way to do this other than using a synchronous call?
    This was just the sort of use case I was going to post: server side validation of some data before proceeding: thats precisely the situation I find myself in today (albeit having nothing to do with TreePanel, because I get the impression from grepping the ExtJS 3 source code this may have been addressed though I'm not positive).

    But just being asked to provide a use case in such a terse way is bad customer relations in my opinion.

  2. #22
    Sencha User
    Join Date
    Sep 2009
    Posts
    54
    Vote Rating
    0
    saicextsupport is on a distinguished road

      0  

    Default response to Animal, why sync AJAX can be useful

    response to Animal, why sync AJAX can be useful


    Unit test with JSUnit, as I run a scenario, I need to open a file and parse it.. This is one example where it would be useful to have sync: option.

    What's the best way for Ext JS 2.3?

  3. #23
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    There's no reason why the drop has to be performed inline.

    It can be performed in the Ajax response handler.

    I've actually done this for a customer.

  4. #24
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Quote Originally Posted by saicextsupport View Post
    Unit test with JSUnit, as I run a scenario, I need to open a file and parse it.. This is one example where it would be useful to have sync: option.

    What's the best way for Ext JS 2.3?
    Parse it in the Ajax success handler.

  5. #25
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Quote Originally Posted by jemptymethod View Post
    But just being asked to provide a use case in such a terse way is bad customer relations in my opinion.
    What supplier is talking to what customer?

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

      0  

    Default Use case for Sync AJAX request

    Use case for Sync AJAX request


    We have some tree. Each node of this tree corresponds to some data record in database table on server. For example we have table that contains hierarchy of product categories of internet-shop (task list in project management system, groups and users in instant messenger store, ...) - in any real project tree data structure is used.

    Now... We have UI built on ExtJS library. TreePanel, TreeNode, ... and TreeEditor. Some user (admin, project manager, IM user, ...) tries to rename node of tree. What do we need? We have to send request to web server where some server application should save changed data to database. And this request can be whether successful or not. And we must not do something with tree node before we get response (success or failure) from server.

    ExtJS. TreeEditor. What can we do during renaming node? We can subscribe on 'beforecomplete' event and create request there. But we have to cancel or submit edit at once. So user will see whether renamed node or old name in incorrect way. Because maybe renaming won't be done in the database.

    And there are many cases when UI mustn't be changed before response from server comes. Because if we can't use UI library bound to real data it's meaningless.

    I think I've described use case in depth. So, if somebody can explain me how I should realize it with ExtJS I will be very thankful. Because I decided to try using ExtJS in some project about two months ago and if to be honest I am very disappointed so far...

    PS And this issue happens when any update (data changes) takes place... For more example - drag'n'drop functionality...

    Quote Originally Posted by Animal View Post
    Can anyone provide a use case for synchronous requests?

  7. #27
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I don't understand the difficulty.

    Veto the node edit, and set the node's text on return from Ajax. This is a common use case, I've had to do that a few times.

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

      0  

    Red face


    Ok. Try one more time...

    User tried to change some tree node name.
    He clicked at selected node.
    He typed some 'new' name.
    He pressed 'enter'.

    What does he have see during 5 seconds for example while the request goes?

    Your callback method (beforecomplete) has finished. At once. AJAX request can last non-determined time. We have to say your library what it should do.

    editor.on('beforecomplete', function(editor, newValue, originalValue) {
    conn = new Ext.data.Connection();
    conn.request({
    //...
    success: function(responseObject) {
    // everything's fine, we can update tree...
    },
    failure: function() {
    // something's wrong...
    }
    });

    !!!
    What can we do here?!
    editor.cancelEdit(false); - ?
    of just leave as it's all ok and change name to new?

    });

    PS success or failure can be executed the-god-knows-how-long.... But callback function will be finished at once. I really don't understand what I can do in this case.

    PPS The actually SAME case if I drop some item to some place. I need to say your library what should be done but actually I can get real information about that only afrer getting response from server.

  9. #29
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You could show the spinning indicator, and show some temporary text in place of the changed text. Anything you like.

    You have the same problem if you go synchronous. Except that you have locked the entire browser up.

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

      0  

    Default


    I do not like to show user anything.
    I must show user correct information in right way like he wants.

    The tree shows some data. And it hasn't to show anything else.
    When we do something there (renaming, dragging, ...) some result of this action is.
    And we need to show there something. Submitted, canceled, somethings else...
    But we don't want it.

    What should I show in tree you think? "I'm sorry, this item is being loaded".
    Do I need to submit changing? Or cancel?
    It's ridiculous... Really...

    PS Of cause I can hack ExtJS as I'd like and do anything what I want. And maybe nothing will remain from original one. And now I'm doing it unfortunately. Of cause anything can be done.
    But we are living in 21st century. And it's very strange to have API that does not decide typical use cases by two lines of code. It seems sort of WinAPI... When I saw for example that I needed to override 'renderElements' method (TreeNodeUI) to show shomething esle in tree and needed to repeat there all activities from parent method... Really, I just thought about MFC and smiled...

    By the way... ExtJS customers are people all around the world. They ('customers') wants to have solution for some use cases. It will be suitable to use sync AJAX they suppose. Why doesn't ExtJS want to satisfy their wishes but offers some solutions that can not satisfy them?

    PPS One more use case. About drag'n'drop. I drag node from one tree to other one. When I drop item there are only two ways - whether to commit drop or cancel. When I drop item also I send request on server and must not insert new item in target tree as I must not show flying node to source tree if I cancel drop. I should do it only when response comes.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."