easyui窗口自适应确实头大
fit:true
fitColumns:true
只适应于一般的简单情况。
那么这个时候就需要我们手动来自适应窗体了,自己写自适应大小,总不会错吧
window.onresize = function(){
/* $('#p').portal('resize'); */
$('#p1').panel('resize',{
width: $(parent).width()/2-137,
height: $(parent).height()-283
});
$('#p2').panel('resize',{
width: $(parent).width()/2-137,
height: $(parent).height()-283
});
$("#tt").datagrid("resize",{
height:$(parent).height()-321,
width:$(parent).width()/2-145,
});
};
监听每次窗口大小的变化,resizedatagrid的大小就可以了。另外如果调用fit:true来自适应页面,那么会重新从服务器加载数据