PDA

View Full Version : ContentPanel doesn't load comboBoxes



reaper.br
13 Sep 2007, 2:07 PM
Hello all. I've tried to sort this problem the whole day, and i managed to, but i'm not satisfied with the solution, so, i'd like to share my code to see if anyone's got a better solution. Maybe someone could post and different way to to this...

Here's my problem: I have a borderLayout with West and center regions. On my west region i have a TreePanel and when i click on a node, it calls a new page on the center panel...


tree.on('click', function(node, e) {
var pnlConteudo = layout.findPanel('conteudo');
pnlConteudo.load({
url: 'EnviaEmail.asp',
scripts: true
});

});


After the page is loaded and i click on my comboBox inside my form, i get the el has no properties error. here's a code from one of the combos


new Ext.form.ComboBox({
width: 230,
fieldLabel: 'Departamento',
id: 'departamento',
typeAhead: true,
lazyRender: true,
mode: 'local',
triggerAction: 'all',
resizable: true,
forceSelection:true,
emptyText: 'Selecione um departamento',
hiddenName: 'depto',
valueField: 'email',
displayField: 'depto',
store: new Ext.data.SimpleStore({
fields: ['email', 'depto'],
data: [
.............................
]
}),
tabIndex: 8
})


Anyway, the form runs normally when i load the page directly on my browser.

well... any suggestions???

Thanks in advance.
Cheers

reaper.br
13 Sep 2007, 2:16 PM
Well, i've managed to get that working calling my center pages inside an iframe, but i'm not entirely happy with this solution. Here's my code:



....
layout.add('center', center = new Ext.ContentPanel('conteudo', {resizeEl: 'center-iframe', fitToFrame: true, closable: false }) );

.........
tree.on('click', function(node, e) {
Ext.get('center-iframe').dom.src = 'EnviaEmail.asp';
});


and the html

<div id="conteudo">
<iframe id="center-iframe" frameborder="0" scrolling="auto" style="border:0px none;"></iframe>
</div>


Thanks

reaper.br
14 Sep 2007, 4:09 AM
well, i'll stick with the iframe solution for now. But later i'll try to make the calls with Ext.ajax.

But for now, on IE6 i got 2 scrollbars (1 from IE, other from the iframe). I changed the iframe props, but no success...

Help here??

Thankkss

Grimsk
14 Sep 2007, 4:57 AM
played with css?

overflow: visible/hidden
or set a greater value to height?

reaper.br
14 Sep 2007, 5:22 AM
On my first post, when i tried to do the normal load method of the panel, my form is rendered, but when i click on my comboBox, i get the el has no properties error.

Then reading the tutorials about Using Layouts with Ext - Part 1 (http://extjs.com/learn/Tutorial:Using_Layouts_with_Ext_-_Part_1), there was something about using iframes... I've copied his example and my form worked, but I didn't like this way of doing this, so that's why i've asked for help.

btw, i also tried to use the getUpdateManager, but i had the same error as the load one...


var pnlConteudo = Ext.get('conteudo');
var updater = pnlConteudo.getUpdateManager();
updater.loadScripts = true;
updater.update({
url: 'EnviaEmail.asp',
scripts: true,
nocache: true
})

reaper.br
14 Sep 2007, 5:40 AM
played with css?

overflow: visible/hidden
or set a greater value to height?

Yes, and none worked