Ext gurus
i have one doubt in combo box.
i want to populate my combo box with the predefined <select> tag
Code:
<select name="ddlTitle" id="ddlTitle" class="inputText">
<option value="">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
</select>
i used the following code and i am getting the combo box also
Code:
new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'ddlTitle',
width:135,
forceSelection:true
});
but its not creating at the right position.
i am creating my rest of my from using
Code:
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';
var simple = new Ext.form.Form({
labelWidth: 115, // label settings here cascade unless overridden
method:'post',
url:'process.aspx',
labelAlign: 'left'
});
simple.fieldset(
{legend:'Contact Information'},
new Ext.form.ComboBox({
fieldLabel: 'Title',
hiddenName:'Title',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'Title'],
data : Ext.Title.Title
}),
displayField:'Title',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select...',
selectOnFocus:true,
width:125,
allowBlank:false
}),
new Ext.form.ComboBox({
fieldLabel: 'Title',
typeAhead: true,
triggerAction: 'all',
transform:'ddlTitle',
width:135,
forceSelection:true
}),
new Ext.form.TextField({
fieldLabel: 'Forename',
name: 'txtForename',
width:125,
allowBlank:false
})
);
simple.addButton('Save', function(){
if (simple.isValid())
{
simple.submit({
waitMsg:'Plz wait ...',
success:function(form, action){
window.location = "http://www.yahoo.com";
},
failure: function(form, action) {
Ext.MessageBox.hide();
Ext.MessageBox.alert('Error', 'Access Denied!!! ');
}
});
}
else
{
Ext.MessageBox.alert('Error', 'Please enter all the values');
}
}, simple);
simple.render('form-ct');
and my HTML markup
Code:
<div id="form-ct">
<select name="ddlTitle" id="ddlTitle" class="inputText">
<option value="">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
</select>
</div>
plz advice how to show my transformed combo box next to the label like it did when we are using a seperate .js file for fetching the title
Thanks
Guru singh