1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    20
    Vote Rating
    1
    oohogwash is on a distinguished road

      0  

    Default listener context is different ?

    listener context is different ?


    I am not sure what is going on here.
    It seems the object context is different, I don't know enough to be able to see why. I am used to C++ etc where the context is well defined... I don't know whats wrong.

    init: function() {
    this.callParent();
    Ei.sys.Appdata.addListener( 'onClientConfigChange', this.onClientConfigChange);
    this.setStartTitle('opal'); // this call works
    },
    setStartTitle:function(newTitle){
    console.log('set title ' + newTitle)
    },
    onClientConfigChange:function(){
    this.setStartTitle('test'); // this call fails with
    Uncaught TypeError: Object [object Object] has no method 'setStartTitle'

    },

  2. #2
    Sencha User
    Join Date
    May 2012
    Posts
    20
    Vote Rating
    1
    oohogwash is on a distinguished road

      0  

    Default help

    help


    No response as yet, I think this is a simple problem for those experienced in this area, please help.
    BTW I have tried a number of combinations but nothing works.
    Is it not possible to pass a function property to an event callback and have the callback function know the object instance it is associated with.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Vote Rating
    0
    link41489 is on a distinguished road

      0  

    Default


    Its failing because thats not the correct scope. If you put a break point on "this.setStartTitle" in your onClientConfigChange function, you can see that "this" has no method "setStartTitle" which is the error message you are seeing. You can pass a scope in when you add your listener.

    The third parameter is the scope.
    Ei.sys.Appdata.addListener( 'onClientConfigChange', this.onClientConfigChange, this);

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    20
    Vote Rating
    1
    oohogwash is on a distinguished road

      0  

    Default Thanks

    Thanks


    It works with that paramater, Thank you.

    I have found my biggest issue with ExtJs is that the library is hard to browse for functions and arguments, the lack of proper code completion and classbrowsing is taking the fun out of what could be a world beater...
    I have yet to find a good editor and doubt one exists, this is probably more of a Javascript issue as much as ExtJs.

    After trying Sencha Architect, Eclipse, Vi .... I have settled on Netbeans. But am still decades behind the C++ world.

    If you know of something that helps on this side please let me know.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi