1. #1
    Ext User
    Join Date
    Oct 2008
    Location
    Rio de Janeiro
    Posts
    34
    Vote Rating
    0
    abnervv is on a distinguished road

      0  

    Question success fn scoped ???

    success fn scoped ???


    Code:
     form.submit({
                                                        waitTitle: 'Aguarde...'
                                                        ,waitMsg:'Salvando dados...'
                                                        ,url : '/GA/ga'
                                                        ,params:{
                                                            cmd:'CmdCadastroUsuarios'
                                                            ,acao:'salvar'
                                                        }
                                                        ,success: function(objForm,objAction) {
                                                                                                                    Ext.MessageBox.show({
                                                                title: 'Mensagem'
                                                                ,msg: objAction.result.mensagem
                                                                ,buttons: Ext.MessageBox.OK
                                                                ,closable:false
                                                                ,icon: Ext.MessageBox.INFO
                                                            });
    this.updateStore();
    
                                                            
                                                        }
                                                        ,failure: function(objForm,objAction) {
                                                            Ext.MessageBox.show({
                                                                title: 'Mensagem'
                                                                ,msg: objAction.result.mensagem
                                                                ,buttons: Ext.MessageBox.OK
                                                                ,closable:false
                                                                ,icon: Ext.MessageBox.ERROR
                                                            });
                                                        }
                                                    });
    I have extended Form component
    and I need these functions
    'success' and 'failure' scoped

    I've tried sth like this...

    Code:
     
    success: {fn:function(objForm,objAction) {
                                                            Ext.MessageBox.show({
                                                                title: 'Mensagem'
                                                                ,msg: objAction.result.mensagem
                                                                ,buttons: Ext.MessageBox.OK
                                                                ,closable:false
                                                                ,icon: Ext.MessageBox.ERROR
                                                            });
                                                        },scope: this}
    but it didn't work...

    any help???

    thankss!
    "Qualquer tecnologia suficientemente avançada é indistinguível da mágica" - Arthur C. Clarke
    ------------------------------------------------
    ExtJs and Java!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    What do you mean "work"?

    Since you are not using "this" in those callbacks, scope is irrelevant.

  3. #3
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @abnervv

    Just add:
    Code:
     form.submit({
                                                        waitTitle: 'Aguarde...'
                                                        ,waitMsg:'Salvando dados...'
                                                        ,url : '/GA/ga'
                                                        ,params:{
                                                            cmd:'CmdCadastroUsuarios'
                                                            ,acao:'salvar'
                                                        }
                                                        ,scope : this //default
                                                        ,success: function(objForm,objAction) {
                                                                                                                    Ext.MessageBox.show({
                                                                title: 'Mensagem'
                                                                ,msg: objAction.result.mensagem
                                                                ,buttons: Ext.MessageBox.OK
                                                                ,closable:false
                                                                ,icon: Ext.MessageBox.INFO
                                                            });
    this.updateStore();
    
                                                            
                                                        }
                                                        ,failure: function(objForm,objAction) {
                                                            Ext.MessageBox.show({
                                                                title: 'Mensagem'
                                                                ,msg: objAction.result.mensagem
                                                                ,buttons: Ext.MessageBox.OK
                                                                ,closable:false
                                                                ,icon: Ext.MessageBox.ERROR
                                                            })
                                                        }.createDelegate(someOtherScope)
                                                    });
    "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.


  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Rio de Janeiro
    Posts
    34
    Vote Rating
    0
    abnervv is on a distinguished road

      0  

    Smile


    Thanks a lot.

    I will test this.

    It seems its gonna work.

    Hugz!
    "Qualquer tecnologia suficientemente avançada é indistinguível da mágica" - Arthur C. Clarke
    ------------------------------------------------
    ExtJs and Java!

  5. #5
    Ext User
    Join Date
    Oct 2008
    Location
    Rio de Janeiro
    Posts
    34
    Vote Rating
    0
    abnervv is on a distinguished road

      0  

    Thumbs up


    yes, as I thought I could call that fn 'updateStore'

    how couldn't I think of ..? LOL

    Thanks! Again...
    "Qualquer tecnologia suficientemente avançada é indistinguível da mágica" - Arthur C. Clarke
    ------------------------------------------------
    ExtJs and Java!

  6. #6
    Ext User
    Join Date
    Oct 2008
    Posts
    127
    Vote Rating
    0
    wp.joju is on a distinguished road

      0  

    Default


    doesn't your message box dimensions change when used inside a form submit's callback function? it looks ok on the first submit but on the succeeding showing of the message box, it's height is not proportional to its width anymore... too much height

  7. #7
    Ext User
    Join Date
    Oct 2008
    Location
    Rio de Janeiro
    Posts
    34
    Vote Rating
    0
    abnervv is on a distinguished road

      0  

    Cool


    I didn't notice this...
    Have u tested that?
    "Qualquer tecnologia suficientemente avançada é indistinguível da mágica" - Arthur C. Clarke
    ------------------------------------------------
    ExtJs and Java!

  8. #8
    Ext User
    Join Date
    Oct 2008
    Posts
    127
    Vote Rating
    0
    wp.joju is on a distinguished road

      0  

    Default


    message box width problem surely exists in v3.0.0... if you will not explicitly set the messagebox width, it will use the width of the previously shown messagebox... but this is fixed in v3.0.3

    although i think this post suggest otherwise http://www.extjs.com/forum/showthread.php?p=412013

  9. #9
    Ext User
    Join Date
    Oct 2008
    Location
    Rio de Janeiro
    Posts
    34
    Vote Rating
    0
    abnervv is on a distinguished road

      0  

    Smile


    I'm using Ext 3.0.1 and I've tried to reproduce that bug
    but I could not... Ext 3.0.1 does not have this bug...
    as I read that thread u linked
    It happens in Ext 3.0.3 ? right?
    "Qualquer tecnologia suficientemente avançada é indistinguível da mágica" - Arthur C. Clarke
    ------------------------------------------------
    ExtJs and Java!

  10. #10
    Ext User
    Join Date
    Oct 2008
    Posts
    127
    Vote Rating
    0
    wp.joju is on a distinguished road

      0  

    Default


    i experienced this while using v3.0.0