Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    52
    Answers
    2
    Vote Rating
    1
    testvogel is on a distinguished road

      0  

    Default Answered: Ajax.request callback, no reference to controller

    Answered: Ajax.request callback, no reference to controller


    Hi,

    I'm doing a Ajax request in my controller and have defined a callback method which should be called after the request:

    Code:
    			Ext.Ajax.request({
    				url: 'http://192.168.137.1:8080/example/',
    				method:'POST', 
    				headers: {
    					'Content-Type': 'application/json'
    				}, 
    				callback: this.ajaxResponse,
    				params: Ext.JSON.encode(form.getValues())
    			})
    ajaxResponse will be called, but after this ajax request I want to change the view and dont have a reference to this controller with 'this'. This means that

    Code:
     this.addRef(....)
    is not working, because addRef is unknown.
    Any ideas why I have loose the controller reference?

  2. Code:
    Ext.Ajax.request({
    				url: 'http://192.168.137.1:8080/example/',
    				method:'POST', 
    				headers: {
    					'Content-Type': 'application/json'
    				}, 
                                    scope : this,
    				callback: this.ajaxResponse,
    				params: Ext.JSON.encode(form.getValues())
    			})

Thread Participants: 1

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