PDA

View Full Version : Combo Box is not getting filled when using in Form/Window



adn295
1 Mar 2013, 4:19 AM
Hi All,

This is my script -
/* To open new obj form */
function openobj() {
var obj_spec_store = new Ext.data.SimpleStore({
url : 'mngr_obj_ajx.php',
fields : [ 'value', 'text' ]
});
obj_spec_store.load({
params : {
todo : 'Get_obj_Spec'
}
});
var parent_obj_store = new Ext.data.SimpleStore({
url : 'mngr_obj_ajx.php',
fields : [ 'value', 'text' ]
});
parent_obj_store.load({
params : {
todo : 'Get_Parent_obj'
}
});
var menuWin = new Window('menuWindow', {
title : "Create obj",
width : 980,
height : 340,
id:'menuWin',
draggable : true,
destroyOnClose : true,
hideEffect : Element.hide,
showEffect : Element.show,
minimizable : false,
maximizable : false,
closable : true,
resizable : false,
items : [ new Ext.FormPanel({
renderTo : 'create_obj_form',
id : 'mngobjForm',
layout : 'form',
height : innerHeight - 250,
width : innerWidth - 50,
frame : true,
destroyOnClose : true,
defaults : {
msgTarget : 'side',
labelSeparator : ''
},
labelAlign : 'right',
items : [ {
xtype : 'combo',
fieldLabel : 'obj Specification ',
store : obj_spec_store,
displayField : 'text',
valueField : 'value',
mode : 'local',
emptyText : 'Select Specification...',
triggerAction : 'all',
name : 'specId2',
id : 'specId2',
hiddenName : 'specIdHid',
width : 150,
forceSelection : false,
editable : true,
selectOnFocus : true
}, {
xtype : 'combo',
fieldLabel : 'Parent obj ',
store : parent_obj_store,
displayField : 'text',
valueField : 'value',
mode : 'local',
emptyText : 'Select obj...',
triggerAction : 'all',
name : 'specId3',
id : 'specId3',
hiddenName : 'objIdHid2',
width : 150,
forceSelection : false,
editable : true,
selectOnFocus : true
}, {
xtype : 'combo',
fieldLabel : 'Dependent obj ',
store : parent_obj_store,
displayField : 'text',
valueField : 'value',
mode : 'local',
emptyText : 'Select obj...',
triggerAction : 'all',
name : 'specId4',
id : 'specId4',
hiddenName : 'objIdHid3',
width : 150,
forceSelection : false,
editable : true,
selectOnFocus : true
} ]
}) ]
});
menuWin.getContent().innerHTML = $('contentWindow').innerHTML;
menuWin.show();
menuWin.setDestroyOnClose();
menuWin.showCenter(true);
menuWin.doResize(true);
$("menuWindow_close").onclick = function(e) {
if (menuWin)
menuWin.hide();
closeCal();
};
}

when I use combo box directly out side window, I am getting values. But when I paste them in Window (contectwindow), I don't get any data, but getting only combo box.


Please help.

sword-it
1 Mar 2013, 5:47 AM
Hi,

In your code may be scope problem that's why combo is not able to get its store
give some id to your combo store and try to do like this
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.StoreManager

adn295
1 Mar 2013, 6:01 AM
:)