【发布时间】:2013-02-20 23:03:28
【问题描述】:
我在 EXTJ 工作,请查看以下示例:
var containerForm=Ext.widget('panel',{
width: 1100,
border: false,
frame: true,
"layout":"fit",
title: 'Add User',
hidden:true,
listeners:{
'afterrender': function(panelObj,eOpts )
{
panelObj.doLayout();
}
}
});
上面面板的 HTML 正在通过 ajax 响应更新,如下代码所示:
formObj.update(jsonResp.html,true,function(){
containerForm.doLayout();containerForm.focus();
});
containerForm 是自动高度面板,因为这个面板是多用途的,
当“formObj.update”填充此面板内容时,它的内容加载正常,但是
如果 ajax 响应 "jsonResp.html" 有任何图像,那个时候 doLayout() 函数没有帮助正确对齐面板高度,
我在 2 个地方添加了 doLayout 函数,但在上述情况下回调函数对我没有帮助:
当我在 2 秒后调用 doLayout 函数时,它才会正常工作:
formObj.update(jsonResp.html,true,function(){
setTimeout('containerForm.doLayout(); containerForm.focus();', 2000);
});
哪个监听器适合使用 doLayout 函数?
【问题讨论】:
标签: javascript extjs javascript-framework