Hybrid View
-
13 Jan 2009 9:05 AM #1
set button hidden to false
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?
Thanks for your Help!!Code:buttons:[{ text:'speichern', id:'create', hidden:true, handler:function(){ myContacts.getForm().submit({ method:'POST', params:{'event':'createContact'}, success:function(r){ win.hide() } }) } }]
Frank
-
13 Jan 2009 9:42 AM #2
Code:buttons[0].setVisibility(true)
-
13 Jan 2009 10:41 AM #3
I tryed your code and become an error: 'button is not defined'
My complete form:
Any other solution?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() } }) } }] });
Thanks
Frank
-
13 Jan 2009 10:53 AM #4
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?Code:myContacts.buttons[0].setVisible(true);
-
14 Jan 2009 8:07 AM #5
Hello zhegwood,
thanks for your Help. My Problem is fixed now.
Frank


Reply With Quote