PDA

View Full Version : not validating combobox in grid editor



kamalakarreddy vancha
3 Dec 2014, 4:27 AM
Hi...
I am using Extjs Version 4.2.3.
I am using grid and grid have cellEditing plugin to edit the grid.
Here in editor i am using combobox.
Combobox is working fine but...
here when i enter the random value in combobox it should show the invalid massage like invalid value.
But here it is not showing the massage.
Validateurl is also firing when i enter and tab out from the combobox.
But messaging is not showing here.
Here is my code.

This is stor objest.

var storeGrpCdVar = {
model: 'IsoCdComboModel',
url:'masterslookup/getisolist'
};

here is the code for combo box.
I am using my combo box component.
If i use this inside the form it's working fine and if i enter the random value and tabout from the combobox
then it is displaying the error like invalid.
{
xtype: 'mycombobox',
id:'editorIsoCdComboBoxId',
displayField: 'isoCd',
storeObj: storeGrpCdVar,
valueField: 'isoCd',
name: 'isoCd',
paging:true,
validateUrl:'masterslookup/validateisocd',
columnsCmc:[{
header:Modules.LblsAndTtls.isoCdLbl,
width:60,
dataIndex:'isoCd'
},{
header:Modules.LblsAndTtls.ctrSzLbl,
width:60,
dataIndex:'ctrSize'
},{
header:Modules.LblsAndTtls.containerHtLbl,
width:60,
dataIndex:'ctrHt'
},{
header:Modules.LblsAndTtls.ctrTypeLbl,
width:70,
dataIndex:'ctrType'
},{
header:Modules.LblsAndTtls.descriptionLbl,
width:200,
dataIndex:'sDescr'
}],
validateFailFunc: function (serverRespObjData) {
Ext.getCmp('editorIsoCdComboBoxId').reset();
Ext.getCmp('editorIsoCdComboBoxId').markInvliad('Invalid');
return true;
},
listeners: {
select : function(combo,records) {
var gridRecod = Ext.getCmp(Modules.CompIds.ReleaseOrderGridId).getSelectionModel().getLastSelected();
gridRecod.set('ctrSize',records[0].get('ctrSize'));
gridRecod.set('ctrHt',records[0].get('ctrHt'));
gridRecod.set('ctrType',records[0].get('ctrType'));
},
beforequery:function(queryEvent){
delete queryEvent.combo.lastQuery;
}
}

}

Help me in this...

Thanks
Kamalakar

Scott-1
3 Dec 2014, 7:09 AM
try using as part of the combo box, have not validated it.

isValid: function(){
var me = this;
if (me.rawValue != 'Is Correct'){
me.markInvalid('Not Correct');
return false;
}
else {
me.clearInvalid( );
return true;
}
}

kamalakarreddy vancha
4 Dec 2014, 5:09 AM
Thanks for your reply..
It's working fine but....
when i select the value from the drop down and tab out then value is not displaying in combo box.
it is not showing any value.
help me in this....

Thanks