PDA

View Full Version : Grid With Combo Box



thilakmsc
8 Aug 2012, 2:32 AM
Dear All .,

I have Grid with Combo box and Text box in same row., If i select value=1 from combobox Text state is visible., If select Value=0 means (Textbox)it's show in Gray color.

Mat i know how to Write code in Index change.

If any one have Country, state example please forward your code to my Email id:thilakraj@angleritech.com

scottmartin
8 Aug 2012, 8:08 AM
You will need to be more detailed in your description of what you want.

Scott.

thilakmsc
8 Aug 2012, 7:38 PM
Dear Scott.,

I need to do change the disable properties of text box in Combobox Index Change.

For the Example.,

In ComboBox(Have Country name's)
India

USA

UAE

In Text box They need to enter their address(Only India and USA User)

If user select India Text box visible true

If user select USA Text box visible true

If user select UAE Text box visible false

scottmartin
8 Aug 2012, 8:02 PM
See if this will help:



// The data store containing the list of states
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
});

Ext.create('Ext.form.Panel', {
title: 'Contact Info',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'combobox',
fieldLabel: 'State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
listeners: {
select: function(combo,records){
var form = combo.up('form'),
addr = form.down('#addressfield');
addr.setVisible(combo.value !== 'AZ');
}
}
}, {
xtype: 'textfield',
fieldLabel: 'Address',
itemId: 'addressfield',
}]
});


Scott.

thilakmsc
9 Aug 2012, 3:02 AM
Dear Scott.,

I was implement above sample ., It's work fine in forms. But while using the same code in Grid.,

The whole column hide.

harman
9 Aug 2012, 7:24 AM
can you post a sample code so one can get to the exact problem.