1. #311
    Sencha User
    Join Date
    Jul 2007
    Location
    Italy
    Posts
    134
    Vote Rating
    0
    fermo111 is on a distinguished road

      0  

    Default


    I'm not understanding this one however. It is not required. Do you have an example the contrary?
    Sorry, I wasn't very clear .

    The for loop that I have in my ext-basex version looks like this:
    Code:
    for (var i = 0, l = collection.length; i < l; i++) {
                    block.call(scope, collection[i], i, collection);
                }
    I was simply puzzled by the fact that the first argument (scope) had no alternative value in case that was undefined. I see that now it reads like this:
    Code:
    scope || null
    .

    I wonder if the effect of passing a null does what the mozilla javascript manual says:
    "If a thisObject parameter is provided to forEach, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead."

  2. #312
    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 fermo111 View Post
    ... I wonder if the effect of passing a null does what the mozilla javascript manual says:
    "If a thisObject parameter is provided to forEach, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead."
    Yes, a scope of null or undefined would default to the global (window) scope. I just added
    Code:
    scope || null
    to add clarity. That maintains compat with the ECMA spec for Array.forEach.

    However, if using:
    Code:
    window.forEach([1,2,3], fn)
    the scope defaults to that of the iterable passed to the function. This provides a default scope for Objects, Arrays, Functions, and strings.
    "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.


  3. #313
    Sencha User
    Join Date
    Jul 2007
    Location
    Italy
    Posts
    134
    Vote Rating
    0
    fermo111 is on a distinguished road

      0  

    Default


    Hi Doug

    thanks for the clarification

  4. #314
    Ext User
    Join Date
    Jul 2009
    Posts
    1
    Vote Rating
    0
    gzlizp is on a distinguished road

      0  

    Default


    Hi,

    I trying to use the ajax request with file upload,but it seems that the request still keep asynchronous.can anyone know how to fix it?
    Any help will be deeply appreciated.

    below is my code.

    Code:
    Ext.Ajax.request({
        method: 'post',
        async: false,
        url: 'cr/createCr.do?msg=submitBasicInfo',
        timeout: 60000,
        form: _frmBasicInfo.getEl().dom,
        isUpload: true,
        headers: {
            'Content-type': 'multipart/form-data'
        },
        callback: function(options, success, response){
        }
    });


    Thanks.
    Last edited by gzlizp; 30 Oct 2009 at 1:15 AM. Reason: omit my code.

  5. #315
    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 gzlizp View Post
    Hi,

    I trying to use the ajax request with file upload,but it seems that the request still keep asynchronous.can anyone know how to fix it?
    Any help will be deeply appreciated.
    @gzlizp -- File uploads (Form submits) are always async and cannot be changed as the browser is doing all the work, not the Ajax stack.
    "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.


  6. #316
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    139
    Vote Rating
    1
    Spirit is on a distinguished road

      0  

    Default Understanding JIT

    Understanding JIT


    Hi!

    I have some problems to understand a behavior of JIT:

    The follwoing code should be a sync script request:
    PHP Code:
        var cb =function(loadedmodules){
            if(
    loaded){
                var 
    test = new Ext.Test.User();
            } 
        };

        
    $JIT( {
            
    module:['system/modules/test/test'],
            
    callbackcb,
            
    scopethis,  //callback scope
            
    modulePath ''//(optional) root for request chain
            
    disableCaching true//prevent browser caching of modules
            
    cacheResponses false//true to cache the text content of the module
            
    async false// synchronous request
            
    method:'DOM' //others: 'GET', 'POST', 'DOM' writes to script tags for debugging
        //proxied : false, //if true or config, uses the JSONP transport
        //xdomain : false,  //(optional) for modern browsers supporting cross-domain requests
        //queue:{name:'fast', priority: 2} //(optional) Queuing support
        
    }); 
    It does the request and the "loaded" function gets called. The class which is loaded cant be called. I get a Ext.Test is undefined.

    But if i add the following code:
    PHP Code:
        $JIT.onAvailable (['system/modules/test/test'], function(loaded){
            if(
    loaded){
                   var 
    test = new Ext.Test.User();
            }
        }); 
    Now it works and the second one can be executed. But now it isnt a syncronous call anymore. That would be like an async call if i understand it right.

    Is my loaded file to big and cannot be handled fast enough ?
    Do i have to wait a few seconds after loaded is called ?

    Thanks for advice

  7. #317
    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  

    Thumbs up


    @Spirit --

    method: 'DOM' implies a <script> tag to load your script (which is always asynchronous). The callback would fire when the script is loaded by the browser, not necessarily when the code is executed.

    For fine grain control over a synch request, use the 'GET' method instead. It's callback is not raised until script execution is complete, or:

    use the new (svn/trunk/source/jit.js) $JIT.onClassAvailable method in conjunction with method: 'DOM' :

    Code:
    $JIT( {method: 'DOM'}, 'system/modules/test/test');
    $JIT.onClassAvailable( 'Ext.Test.User', function(loaded){
            if(loaded){
                   var test = new Ext.Test.User();
            }
        }); 
    "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.


  8. #318
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    139
    Vote Rating
    1
    Spirit is on a distinguished road

      0  

    Lightbulb ok

    ok


    Didnt thought about script tags.
    Works like a charm now

    Thx

  9. #319
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    139
    Vote Rating
    1
    Spirit is on a distinguished road

      0  

    Default CSS

    CSS


    I´m still playin around with JIT and i cant get the CSS applied.

    PHP Code:
    $JIT( {
        
    method'GET',
        
    async:false
    }, 'system/modules/test/test''system/modules/test/test.css');

    $JIT.onClassAvailable'Ext.Test.User', function(loaded){

        
    $JIT.onAvailable('test.css', function(success){
            
    success && $JIT.applyStyle('test.css');
        });

        if(
    loaded){

            
    // Sample desktop configuration
            
    Desk = new Ext.app.App({
                
    init :function(){
                    
    Ext.QuickTips.init();
                },
        
                
    getModules : function(){
                    return [
                    new 
    Ext.Test.User(),
                    ];
                },

    ... 
    The test.css will be available and success will be true, but the appeareance of the Test module wont change.
    If i add the same css in the head tag of my index.html file all looks ok.

    Seems to me i m not thinking the right way again.
    Any hints ?

  10. #320
    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


    @Spirit -- Some tweakage:

    PHP Code:
    $JIT.setModulePath('system/modules/test/');
    $JIT( {method'GET',async:false}, 'test');
    // or,   $JIT.get( {async:false}, 'test');
    $JIT.css('test.css');  //has the necessary module caching features for swapping CSS later

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


Thread Participants: 82

  1. galdaka (1 Post)
  2. Digital God (3 Posts)
  3. prophet (1 Post)
  4. alayasf (2 Posts)
  5. tof (1 Post)
  6. stever (3 Posts)
  7. mystix (4 Posts)
  8. fangzhouxing (6 Posts)
  9. ludoo (1 Post)
  10. KRavEN (4 Posts)
  11. DigitalSkyline (3 Posts)
  12. daemach (1 Post)
  13. violinista (1 Post)
  14. mlarese (1 Post)
  15. walker_cn (4 Posts)
  16. stevebla (4 Posts)
  17. Chris in Cambridge (1 Post)
  18. mjlecomte (2 Posts)
  19. ZooKeeper (10 Posts)
  20. brookd (1 Post)
  21. fermo111 (6 Posts)
  22. kevinwu8 (1 Post)
  23. Spirit (3 Posts)
  24. jerrybrown5 (4 Posts)
  25. lvanderree (8 Posts)
  26. Makor (4 Posts)
  27. yanick (1 Post)
  28. wm003 (10 Posts)
  29. radio1 (3 Posts)
  30. jphillips (2 Posts)
  31. markpele (2 Posts)
  32. Romantik (1 Post)
  33. Sander_S (4 Posts)
  34. maximumcoder (2 Posts)
  35. NotChris (6 Posts)
  36. ritchrs (2 Posts)
  37. sksoft (2 Posts)
  38. jvanantwerp (2 Posts)
  39. jfa (2 Posts)
  40. BlueCamel (1 Post)
  41. ClemsonJeeper (3 Posts)
  42. sp797 (1 Post)
  43. mahesh122 (2 Posts)
  44. zombeerose (12 Posts)
  45. jlowe (2 Posts)
  46. bt_bruno (2 Posts)
  47. pompom (4 Posts)
  48. Eric24 (18 Posts)
  49. baumschule (3 Posts)
  50. coderobo (3 Posts)
  51. krause (1 Post)
  52. mubenchi (1 Post)
  53. mrkadakia (3 Posts)
  54. tomim (4 Posts)
  55. canxss (2 Posts)
  56. tasman (3 Posts)
  57. mrsunshine (4 Posts)
  58. Trinad (2 Posts)
  59. jasonb885 (2 Posts)
  60. wki01 (5 Posts)
  61. mschwartz (2 Posts)
  62. sarathy (2 Posts)
  63. jdurante (1 Post)
  64. TomChiverton (1 Post)
  65. sumit.madan (2 Posts)
  66. Riemi (4 Posts)
  67. Henrik Rutzou (3 Posts)
  68. hairinwind (1 Post)
  69. gzlizp (1 Post)
  70. yuanqixun (2 Posts)
  71. larryaubstore (2 Posts)
  72. wupeng (2 Posts)
  73. blueram (1 Post)
  74. ronivcp (1 Post)
  75. t00bs (2 Posts)
  76. hyponym (4 Posts)
  77. mg2468 (3 Posts)
  78. scaddenp (1 Post)
  79. faith wins (3 Posts)
  80. aratcliffe (8 Posts)
  81. jhashe (3 Posts)
  82. jaufgang (1 Post)

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar