PDA

View Full Version : ComboBox issue getting error getPositionEl() is undefined



mlekhs
1 Jun 2011, 8:18 AM
I am having issue with combobox. It is present within a formpanel and this formpanel is an item inside the center panel of ViewPort. When I click on the Combo, it is not populating any data but I am getting an error that getPositionEl() is null or not an object in IE and getPositionEl() is undefined in FF. I had the same combo inside the formpanel ( within a window instead of VP), it was working fine. There is another combobox in the paging toolbar for a grid within the same formpanel, even that has the same error. Tried various ways, but doesnt work. What am i doing wrong? Please help....
Below is the combo code:


function

getStatusStoreDisp(){


var statusStrId = 'statusStrId';


//Do not recreate the store if it already exists.
var statusStr = Ext.StoreMgr.lookup (statusStrId);
if ((statusStr != null) && (statusStr !== undefined)) {
return statusStr;
}


var recordLayout = [
{name: 'statusId', mapping: 'statusId', type: 'int' },
{name: 'statusName', mapping: 'statusName',type: 'string'}
];
var dataMapping = Ext.data.Record.create(recordLayout);
var url = 'getAllStatus.do';


statusStr = new Ext.data.Store({
storeId: statusStrId,
//autoLoad: true,
method:


'GET',

proxy: new Ext.data.HttpProxy({
url: url,
disableCaching: true,
async: false
}),
reader: new Ext.data.JsonReader({
root: 'statusData',
totalProperty: 'totalNumberOfRows',
id: 'statusId'
},dataMapping)
// listeners: {
// loadexception: function(proxy, store, response, e) {
// handleJsonLoadException(response, e);
//}
}
); //end data store initialization
statusStr.load();
return statusStr;


};


var


searchStatusCombo = new Ext.form.ComboBox({

store: getStatusStoreDisp(),
id: 'searchStatus',
name: 'searchStatus',
autoLoad:true,
fieldLabel: 'Status',
mode: 'local',
displayField: 'statusName',
valueField: 'statusId',
//hiddenName: 'statusCode',
editable:


false,

triggerAction: 'all',
lazyInit: false,
//width: 200,
anchor:


'75%',

emptyText:'Select a Status',
shadow: false


});
searchStatusCombo.getStore().load();


Below is the Form Panel Column where the Combo is included:



{
// right column
columnWidth:0.35,
// defaults:{anchor:'75%'},
//fieldLabel: 'Status',
items:[searchStatusCombo]
}


And here is the Center portion of the Viewport where the Form Panel is an item:



{
region:'center'
,layout:


'fit',

autoScroll:true
//,width: 750
//,height:800
,id:


'centerView'

,items:[CompltSearchFormPanel]
,border:true
//,bodyStyle:'background-color:#f0f0f0;'
//,title:'Center'
}

mlekhs
1 Jun 2011, 1:25 PM
Any feedback on this issue?

skirtle
1 Jun 2011, 7:14 PM
Use Firebug or similar to figure out where in the ExtJS source this error is being thrown. Both ColumnLayout and TriggerField use getPositionEl() so it could be either of them.

mlekhs
2 Jun 2011, 5:27 AM
Thanks for your reply. I tried removing TriggerAction:all , still getting the same error. I looked at firebug and the error is thrown at ext-all.js

b.getPositionEl() is undefined
var swfobject=function(){var E="undefi...);Ext.grid.GroupingView.GROUP_ID=1000; (http://www.sencha.com/forum/"{href}"','tpl)Line 11

Any suggestion on what I could be doing wrong? I am using extjs 3.3
I have combobox in few other formpanels as a columnlayout, it works fine there. I am not sure why only this particular one is not working.

mlekhs
2 Jun 2011, 6:05 AM
I figured out the problem. The issue is with adding the FormPanel as an item into viewport. Instead just add the formpanel(containing the combobox) by using .add and then doLayout() on the viewport.

skirtle
2 Jun 2011, 6:35 AM
For future reference, when digging into issues with Firebug you need to use ext-all-debug.js rather than ext-all.js. The debug version will give a useful line number as it hasn't been minified.