Results 1 to 5 of 5

Thread: set button hidden to false

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Nov 2008
    Posts
    9
    Vote Rating
    1
      1  

    Default set button hidden to false

    Hello,

    i created a ExtJS formpanel with 2 hidden buttons. How can i change the hidden value from true to false?

    Code:
    buttons:[{
                text:'speichern',
                id:'create',
                hidden:true,
                handler:function(){
                    myContacts.getForm().submit({
                        method:'POST',
                        params:{'event':'createContact'},
                        success:function(r){
                            win.hide()
                        }
                    })
                }
            }]
    Thanks for your Help!!
    Frank

  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
      0  

    Default

    Code:
    buttons[0].setVisibility(true)

  3. #3
    Ext User
    Join Date
    Nov 2008
    Posts
    9
    Vote Rating
    1
      0  

    Default

    I tryed your code and become an error: 'button is not defined'

    My complete form:
    Code:
    var myContacts = new Ext.FormPanel({
            url:'view/userContacts.cfm',
            bodyStyle:'padding:5px',
            defaults: {width: 230},
            id:'myContacts',
            items:[{
                xtype:'hidden',
                name:'ident',
                id:'ident',
                fieldLabel:'',
            },{
                xtype:'textfield',
                name:'vorname',
                id:'vorname',
                fieldLabel:'Vorname'
            },{
                xtype:'textfield',
                name:'nachname',
                id:'nachname',
                fieldLabel:'Nachname'
            },{
                xtype:'textfield',
                name:'mobil',
                id:'mobil',
                fieldLabel:'Handy'
            },{
                xtype:'combo',
                name:'type',
                id:'type',
                mode: 'local',
                store: type,
                displayField:'type',
                fieldLabel:'Kontakttype'
            },{
                xtype:'textarea',
                name:'memo',
                id:'memo',
                fieldLabel:'Info'
            }],
            buttons:[{
                text:'speichern',
                id:'create',
                hidden:true,
                handler:function(){
                    myContacts.getForm().submit({
                        method:'POST',
                        params:{'event':'createContact'},
                        success:function(r){
                            win.hide()
                        }
                    })
                }
            }]
        });
    Any other solution?

    Thanks
    Frank

  4. #4
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
      1  

    Default

    Code:
    myContacts.buttons[0].setVisible(true);
    Whoops... It's setVisible, not setVisibility for buttons. Also, if you're getting undefined errors, check the rendered property. If it's false, that's probably the problem. When are you trying to show the button, anyway?

  5. #5
    Ext User
    Join Date
    Nov 2008
    Posts
    9
    Vote Rating
    1
      0  

    Default

    Hello zhegwood,

    thanks for your Help. My Problem is fixed now.

    Frank

Posting Permissions

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