1. #11
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I think forum poster hendricd does not charge people for using his user Ext-basex user extension...

  2. #12
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    173
    Vote Rating
    0
    MaxT is on a distinguished road

      0  

    Default Commercial

    Commercial


    http://code.google.com/p/ext-basex/

    I can't access the commercial licence page at the moment, but the last time I looked (several months ago) it quoted a price for the licence.

    Max

  3. #13
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    95
    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


    ext-basex v2.3 is LGPL
    ext-basex v3.0 is GPL/Commercial licence

  4. #14
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by MaxT View Post
    I've had a go at updating this to match the Ext2.2 code.

    The only bit I wasn't too sure about was the setting of headers.
    E.g. the code...

    Code:
    hs['Content-Type']
    This doesn't look right to me. I always thought that a hyphen was an invalid character for property names because it gets interpreted as a subtraction sign.
    i.e.
    Code:
    hs.Content-Type
    is the same as
    Code:
    (hs.Content)-Type
    which is obvioulsy wrong. Maybe you can always get away with it if you only access the property via the square bracket notation?

    Anyway, here is the code.

    Max
    @MaxT -- Javascript does not permit dashes in direct object-member references:
    obj.Content-type

    Must be done this way: obj['Content-type'] = something;

    ...which is why most JSON encoders force quotes around member names.


    Quote Originally Posted by Condor View Post
    I thought everybody used the ext-basex user extension for synchronous AJAX requests.
    Many do, but for other reasons as well:
    • Built-in JSONP support (text, Object, JSON, XML ) -> to a native Ext response Object.
    • Request Queues
    • responseJSON support
    • Basic Auth
    • File system support.
    other goodies, yada, yada...


    Quote Originally Posted by Animal View Post
    Can anyone provide a use case for synchronous requests?
    @Animal -- Use cases:
    • Sequential (transactional) loading of a resource (JS, etc)
    • Realtime form validation server-side (intranets only recommended)
    Quote Originally Posted by MaxT View Post
    Ext-basex requires a Commercial licence. I don't see the point in buying one just to be able to do a synchronous request which can be coded in a few lines.

    Max
    @MaxT -- It's called dual-licensing: GPL 3.0/Commercial
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #15
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    173
    Vote Rating
    0
    MaxT is on a distinguished road

      0  

    Default headers

    headers


    I still think hs['Content-Type'] is a weak implementation because the string "Content-Type" is case insensitive with HTTP. This forces you to use ['Content-Type'] and not any other valid string for the name component of the header field.

    Whilst ext-basex has a dual licence, in my case I can't use GPL 3 for my code. As I have no use at the present time for the other features of the extension it is not worth buying it just to be able to add a synchronous Ajax request. No doubt there are other Ext users, with a commercial Ext licence, in a similar situation and the above patch may help.

    Max

  6. #16
    Ext User
    Join Date
    Aug 2008
    Posts
    9
    Vote Rating
    0
    ryounes is on a distinguished road

      0  

    Default Use case for asynchronous http request

    Use case for asynchronous http request


    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?

  7. #17
    Sencha User wasp's Avatar
    Join Date
    Nov 2007
    Posts
    29
    Vote Rating
    0
    wasp is on a distinguished road

      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?
    True, you cannot do async call in a beforeNodeDrop, but you could do it ( I do it that way ) easily with just adding additional attribute to the node data, that's returned initially from your server, and then use it like node.attributes.can_drop or so, with simple calculations inside JavaScript. This will save you a LOT of calls to your server, as you move over your nodes, there will be a lot of them.

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

      0  

    Arrow


    Arrow
    a few question about the syn ajax :
    * it should be Ext.Ajax.request({ or Ext.lib.Ajax.request for the sample to call
    Ext.Ajax.request({
    url: 'some_page.php',
    method: 'POST',
    success: success,
    failure: failure,
    scope: this,
    params: {foo: 'bar'},
    async: false
    });

    * there are, extjs/ext-2.2/adapter/ext/ext-base.js and extjs/ext-2.2/ext-all.js,
    you mentioned "This is ONLY for use with ext-base.js", does it means there will be a conflicting
    at using ext-all.js ?

  9. #19
    Ext User
    Join Date
    Aug 2008
    Posts
    9
    Vote Rating
    0
    ryounes is on a distinguished road

      0  

    Default


    Quote Originally Posted by wasp View Post
    True, you cannot do async call in a beforeNodeDrop, but you could do it ( I do it that way ) easily with just adding additional attribute to the node data, that's returned initially from your server, and then use it like node.attributes.can_drop or so, with simple calculations inside JavaScript. This will save you a LOT of calls to your server, as you move over your nodes, there will be a lot of them.
    In this case, the validity of the drop depends on properties of both the source and target, so it's not as simple as adding attributes to the nodes. Note that beforeNodeDrop is only called right before an actual drop, not as the node is dragged around, so the concern over lots of server calls is not valid.

  10. #20
    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 Animal View Post
    Can anyone provide a use case for synchronous requests?
    A use case should not be necessary. If the underlying functionality that ExtJS is abstracting away allow synchronous requests, then so should ExtJS. To not do so would be like an ORM framework that does not allow you to issue raw SQL queries. Certainly 98+% of the time you just want to let the framework do the work for you, but when the framework disallows you from doing work you could do, but for the framework, then the framework has just become less valuable, and possibly a hindrance.