PDA

View Full Version : TriggerField problem when contained in a panel borderLayout



oegozi
17 Aug 2009, 11:54 PM
Hi,

I am using ext 2.1 with IE and I have the following problem:
I have a panel using a border layout, in its north part I want to have a triggerField (and a grid in the center), but I get an exception of "object doesnt support this method" regarding the
"this.addEvents" in the
Ext.Component = function(config){ in ext-all debug.js.


by the way, I am quite sure it worked before when I had an anchor layout, but I dont understand why this should make adifference.
and another "by the way", when using a TextField everything works ok.
Here is my code :



/*

* This function creates the query field.

*/

function createQueryField(){



//var query = new Ext.form.TextField({ THIS WORKS!



var query = Ext.form.TriggerField({

onTriggerClick:searchQuery,

id:'myQueryField',

hideLabel:true,

region:'north',

height:'10%',//this is the precentage out of the border layout

width:'100%',

allowBlank:false,

emptyText: getLocalizationValue('application.javascript.search.field.empty.text'),

listeners:{

specialkey:function(field, e){

if(e.getKey()== e.ENTER){

searchQuery();

}

}

}


});

return query;
}


Ext.onReady(function(){

//create grid results

customerSearchGrid = createGrid();

customerSearchGrid.setVisible(false);

customerSearchGrid.doLayout();





queryField = createQueryField();

container =new Ext.Panel({

renderTo:'formPlaceholder1',

id:'mainContainer',

hideMode:'offsets',

height:260,

width:500,

layout:'border',


items:[queryField, customerSearchGrid]


});

customerSearchGrid.getStore().on('beforeload', updateRecordsId);

customerSearchGrid.getStore().on('load', _handleSearchResults);


//executing the size upon load

document.body.onresize =new Function("resizeContent()");

// when in portlet, need to resize the queryField after the resultsPanel was added

if(!isInToolbar()){

updateQueryFieldWidth();

}

resizeContent();


});


Does anyone know the reason for this?

Thanks

oegozi
18 Aug 2009, 11:25 PM
This issue has a very high priority for us, so please respond if you recognize this issue....

oegozi
25 Aug 2009, 12:30 AM
Can anyone from the support team respond to this issue?

Animal
25 Aug 2009, 1:26 AM
var query = Ext.form.TriggerField({

!

new?

oegozi
25 Aug 2009, 3:16 AM
oh, my god, I feel so stupid, I even read once somewhere about someone who forgot to write "new" and had problems, and thought it would never happen to me....
hmmmmm.....
thank u so much!