1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
    Answers
    1
    Madiyana is on a distinguished road

      0  

    Default Unanswered: document.location Ext.Ajax.request

    Unanswered: 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
    Vote Rating
    0
    Answers
    1
    Madiyana is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Have you looked at what document.location gives you? It's not a string
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
    Answers
    1
    Madiyana is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    17
    Vote Rating
    0
    Answers
    1
    Madiyana is on a distinguished road

      0  

    Default


    Ok Thx