Results 1 to 6 of 6

Thread: document.location Ext.Ajax.request

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Answers
    1
    Vote Rating
    0
      0  

    Default document.location Ext.Ajax.request

    Hi,
    I try to change one function for addind Ext.Ajax.Request but I hava a promblem with my url ..
    In my function I use document.location = '' and when i take the 'url' and add it in the Ext.Ajx.Request ,
    My function :
    PS : I take just a part in my function , the part where I do it
    Code:
    if(btn=='yes'){    
     var box = Ext.MessageBox.wait('Traitement en cours ...');
      var arrayIds = [];                   
         Ext.each(grilleResultat.selModel.getSelection(), function(e){            
            arrayIds.push(e.data.Id_Amn);                         
         });
        var jsonLstIds = Ext.JSON.encode(arrayIds);        
        document.location = '/gedeo/amenagement/genererpdf/array/'+jsonLstIds; 
        box.hide();    
       }
     },
    And this code with Ajax

    Code:
        if(btn=='yes'){    
                            var box = Ext.MessageBox.wait('Traitement en cours ...');
                            Ext.Ajax.request({
                                url : '/gedeo/amenagement/genererpdf/array/'+jsonLstIds,
                                params : { jsonLstIds : jsonLstIds },
                                success : function(response, opts){
                                    box.hide();
                                },
                                failure : function(response, options){
                                
                                }
                            });
                 //            document.location = '/gedeo/amenagement/genererpdf/array/'+jsonLstIds; 
                        }
    If someone can help me Pliz.;
    Thanks

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Answers
    1
    Vote Rating
    0
      0  

    Default

    For reformulate my question,

    How can we use document.location in Ext.Ajax.Request .?
    Code:
    Ext.Ajax.request({
                                url : '/gedeo/amenagement/genererpdf/array/'+jsonLstIds,
                                //document.location = '/gedeo/amenagement/genererpdf/array/'+jsonLstIds; 
                                params : { array : jsonLstIds },
                                success : function(response, opts){
                                   box.hide();                              
                                },
                                failure : function(response, options){
                                
                                },

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    Have you looked at what document.location gives you? It's not a string
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Thx , Sorry I am new in ExtJS4 so I get some problem
    So, there is no solution for doint 'document.location ' in Ext.Ajax.Request.;
    I need it

    Thx

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    There definitely is, open up the dev tools of your browser and in the console type document.location and expand it to see what it has. It's basically an object. So you can do document.location.origin for example.

    Also, this isn't Ext JS code, this is native javascript.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Ok Thx

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •