ext.net的GridPanel不能100%显示的解决方法
<ext:GridPanel runat="server" ID="GridPanelTactics" AutoHeight="true" AutoWidth="true" EnableColumnMove="false" AutoScroll="true" EnableDragDrop="false" >
<TopBar>
<ext:Toolbar ID="Toolbar_Tactics" AutoHeight="true" AutoWidth="true" runat="server">
<Items>
<ext:ToolbarFill />
<ext:Button ID="btn_Tactics_Add" runat="server" Text="新增" Icon="Add" OnClientClick="javascript:Fun_AddOrEdit_Tactics('');return false;">
</ext:Button>
<ext:Button ID="btn_Tactics_Add_delete" runat="server" Text="删除" Icon="Delete" OnClientClick="javascript:deleteChoose_Tactics();return false;">
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Store>
...
...
...
这样设置了GridPanel还是不能100%显示
GridPanel以100%显示时 这是GridPanel AutoWidth="true"的bug
解决办法:
$(document).ready(function () {
$("#Relation_removeAttr,#Tactics_removeAttr").click(function () {
$("#Toolbar_Tactics").parent().removeAttr("style");
$("#Toolbar_Tactics").parent().attr("style", "width: auto");
});
});
//其中Toolbar_Tactics为Toolbar的ID
------解决方案--------------------没用过ext.net,手工写过,
配置layout: "fit"