sankarbaluz
15 Nov 2011, 6:18 AM
Hi,
In my combo box,with out setting "forceSelection:true",I need to check the typing characters would match with the server.I mean to say,If the user is typing fast some characters in combobox,it should check with the server and return a response.
The following is the code which I am using.Please provide me a better solution for this.
var cmpVIA = {
xtype:'pnccombobox',
store: dsVIA,
forceSelection:false,
allowBlank:false,
id:'cmbVIA',
displayField:'viaNo',
valueField:'intViaNo',
fieldLabel:'VIA',
width:160,
labelWidth:40,
matchFieldWidth:false,
typeAhead: true,
triggerAction: 'all',
selectOnFocus:true,
listConfig: {
width:250,
loadingText: 'Loading...',
height:100,
deferEmptyText:false,
emptyText:'No Values Found!',
getInnerTpl: function() {
return '<table><tr><td colspan="2" height="5"></td></tr><tr valign="top"><td width="125px" align="left">{viaNo}</td><td width="125px" align="left">{vslNm}</td></tr><tr><td height="2"></td></tr><tr valign="top"><td align="left">{etaDttm}</td><td align="left">{etdDttm}</td></tr><tr><td height="2"></td></tr><tr valign="top"><td align="left">{dschVoyNo}</td><td align="left">{ldVoyNo}</td></tr><tr><td colspan="2" height="5"></td></tr></table>';
}
},
listeners:{
select:function(combo,record){
var index = combo.store.find('intViaNo', combo.getValue());
var setVesselTime = combo.store.data.items[index].data.etaDttm;
intViaNumber = combo.store.data.items[index].data.intViaNo;
Ext.getCmp('idDateField').setValue(setVesselTime);
Ext.getCmp('viaCnsrtmCdId').setValue(record[0].data.cnsrtmCd);
categorySelectedId = this.getValue();
}
}
};
In my combo box,with out setting "forceSelection:true",I need to check the typing characters would match with the server.I mean to say,If the user is typing fast some characters in combobox,it should check with the server and return a response.
The following is the code which I am using.Please provide me a better solution for this.
var cmpVIA = {
xtype:'pnccombobox',
store: dsVIA,
forceSelection:false,
allowBlank:false,
id:'cmbVIA',
displayField:'viaNo',
valueField:'intViaNo',
fieldLabel:'VIA',
width:160,
labelWidth:40,
matchFieldWidth:false,
typeAhead: true,
triggerAction: 'all',
selectOnFocus:true,
listConfig: {
width:250,
loadingText: 'Loading...',
height:100,
deferEmptyText:false,
emptyText:'No Values Found!',
getInnerTpl: function() {
return '<table><tr><td colspan="2" height="5"></td></tr><tr valign="top"><td width="125px" align="left">{viaNo}</td><td width="125px" align="left">{vslNm}</td></tr><tr><td height="2"></td></tr><tr valign="top"><td align="left">{etaDttm}</td><td align="left">{etdDttm}</td></tr><tr><td height="2"></td></tr><tr valign="top"><td align="left">{dschVoyNo}</td><td align="left">{ldVoyNo}</td></tr><tr><td colspan="2" height="5"></td></tr></table>';
}
},
listeners:{
select:function(combo,record){
var index = combo.store.find('intViaNo', combo.getValue());
var setVesselTime = combo.store.data.items[index].data.etaDttm;
intViaNumber = combo.store.data.items[index].data.intViaNo;
Ext.getCmp('idDateField').setValue(setVesselTime);
Ext.getCmp('viaCnsrtmCdId').setValue(record[0].data.cnsrtmCd);
categorySelectedId = this.getValue();
}
}
};