PDA

View Full Version : How to check whether component (button is available or not in extjs



vijayakumar84
24 Apr 2013, 9:32 AM
Hi
I have the 4 combobox .If user select the value from combo box .need to add button eg if user select first combo create button and display selected value in button.if user select another value in combo need to display selected value in button.If user select second combo need to create another button and display with selected value can anybody tell how to do



Thanks

zzhouag
25 Apr 2013, 1:24 AM
maybe you can create the button first and hide the button, and fire the 'change' event in combobox then use setVisible() and setText() to show button and set button text

like:
this.button = {
itemId: 'button',
text: ' ',
hidden: true
}

{
xtype: 'combo',
listeners:{
change: function(c, newval, oldval){
c.up('...').down('#button').seVisible(true)
c.up('...').down('#button').setText("newval")
}
}
}

something like that, hope can help you