PDA

View Full Version : panel autoload file problems



riseman
25 Sep 2008, 1:41 AM
there is a file as follow:

a.html



Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();
//north
new Ext.Panel({
id: 'northPanel',
region: 'north',
split: true,
collapseMode: 'mini',
maxSize: 42,
height: 42,
border: true,
margins: '0 0 0 0'
});

//west
new Ext.Panel({
id: 'westPanel',
region: 'west',
split: true,
collapseMode: 'mini',
layout: 'border',
minSize: 150,
maxSize: 500,
width: 300,
border: false,
margins: '0 0 0 0',

});
//center
new Ext.Panel({
id: 'centerPanel',
region: 'center',
split: true,
collapsible: false,
layout: 'fit',
autoLoad: {url: 'b.jsp',scripts:true},
border: true,
margins: '0 5 5 0'
});

new Ext.Viewport({
id: 'viewport',
layout: 'border',
items:[
Ext.getCmp('northPanel'),Ext.getCmp('westPanel'),Ext.getCmp('centerPanel')
]
});
});
</script>


the b.jsp file as follow:



<script>
function importData(){
var importWin = new Ext.Window({
renderTo:'importData',
layout:'fit',
width:300,
height:100,
style:'height:200',
items:new Ext.form.FormPanel({
id:'importDataForm',
fileUpload:'true',
layout:'fit',
frame:'true',
url:'' (http://extjs.com/forum/''),
height:100,
defaults:{
style:'height:22px;width:200'
},
items:[{ xtype:'textfield',name:'file', inputType: 'file'}],

})
});
importWin.setPosition(200,100);
importWin.show();
}

}

</script>
<body>
<div id ="importData"><a href="javascript:importData()">click me</a></div>
</body>


when i click "click me " losts of time ,in every time ,the window appeared in difference,it's style value in difference. the inner componet also is difference in every time
the first time is:
<input style="height: 22px; width: 280px;" class="x-form-file x-form-field" size="20" autocomplete="off" id="ext-comp-1010" name="file" type="file">
the second time is :
<input style="height: 136px; width: 274px; left: 504px; top: 111px;" class="x-form-file x-form-field" size="20" autocomplete="off" id="ext-comp-1026" name="file" type="file">

why ?
if the b.jsp request in a alone file,it work well.just load in panel,the problem appeared

25 Sep 2008, 4:10 AM
why are you setting the height via Javascript and height via css? You should use the javascript.

riseman
25 Sep 2008, 5:51 PM
i remove the setting height via style code,but no help.
could you repeat my code in you enviroment and show me the result?
could you help me to solve the problem or get the reason