Ext.net rowexpander 调整标题大小而不是调整内容大小
Posted
技术标签:
【中文标题】Ext.net rowexpander 调整标题大小而不是调整内容大小【英文标题】:Ext.net rowexpander resize header not resize content 【发布时间】:2013-11-04 19:58:52 【问题描述】:我正在使用 .net 4 和 ext.net 2.2 我面临上述问题: 我有上面的网格面板
<ext:GridPanel ID="GridPanelSites" runat="server" StoreID="StoreSites" Title="" ForceFit="true">
<View>
<ext:GridView ID="GridViewSites" runat="server" LoadMask="true" LoadingText="" />
</View>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModelSites" runat="server" />
</SelectionModel>
<ColumnModel>
<Columns>
<ext:Column ID="col_address" runat="server" DataIndex="address" Text="" />
<ext:Column ID="col_city" runat="server" DataIndex="city" Text="" />
<ext:Column ID="col_contact_name" runat="server" DataIndex="contact_name" Text="" />
<ext:Column ID="col_police_phone1" runat="server" DataIndex="police_phone1" Text="" />
<ext:Column ID="col_children" runat="server" DataIndex="children" Text="" />
<ext:Column ID="col_old_people" runat="server" DataIndex="old_people" Text="" />
<ext:Column ID="col_total_people" runat="server" DataIndex="total_people" Text="" />
<ext:ImageCommandColumn ID="col_edit" Text="" Align="Center" Width="100" runat="server">
<Commands>
<ext:ImageCommand ToolTip-Text="" CommandName="cmdEditSite" Icon="HouseLink" />
</Commands>
<Listeners>
<Command Fn="onCommand" />
</Listeners>
</ext:ImageCommandColumn>
</Columns>
</ColumnModel>
<Features>
<ext:GridFilters runat="server" ID="GridFiltersMSites" Local="true">
<Filters>
<ext:StringFilter DataIndex="address" />
<ext:StringFilter DataIndex="contact_name" />
<ext:StringFilter DataIndex="total_people" />
</Filters>
</ext:GridFilters>
</Features>
<Plugins>
<ext:RowExpander>
<Component>
<ext:GridPanel ID="GridPanelChildren" runat="server" Height="300" Layout="FitLayout"
StoreID="StoreActions" Title="">
<View>
<ext:GridView ID="GridViewChildren" runat="server" LoadMask="true" LoadingText="" />
</View>
<SelectionModel>
<ext:RowSelectionModel ID="SelectionModelChildren" runat="server" />
</SelectionModel>
<ColumnModel>
<Columns>
<ext:Column ID="col_child_actiondescription" runat="server" DataIndex="action_description"
Text="" />
<ext:Column ID="col_child_type" runat="server" Width="70" DataIndex="actiontype_description"
Text="" />
<ext:Column ID="col_child_description" runat="server" Width="300" DataIndex="description"
Text="" />
<ext:Column ID="col_child_date" runat="server" Width="150" DataIndex="inserted_date"
Text="" />
<ext:Column ID="col_child_user" runat="server" Width="150" DataIndex="update_user_fullname"
Text="" />
</Columns>
</ColumnModel>
<Features>
<ext:GridFilters runat="server" ID="GridFiltersActions" Local="true">
<Filters>
<ext:StringFilter DataIndex="action_description" />
<ext:ListFilter DataIndex="actiontype_description" />
<ext:StringFilter DataIndex="description" />
<ext:StringFilter DataIndex="update_user_fullname" />
<ext:DateFilter DataIndex="inserted_date" />
</Filters>
</ext:GridFilters>
</Features>
</ext:GridPanel>
</Component>
<DirectEvents>
<BeforeExpand OnEvent="BeforeExpandChild">
<EventMask Msg="" ShowMask="true">
</EventMask>
<ExtraParams>
<ext:Parameter Name="id" Value="record.getId()" Mode="Raw" />
</ExtraParams>
</BeforeExpand>
</DirectEvents>
</ext:RowExpander>
</Plugins>
</ext:GridPanel>
当我重新调整父级标题的大小时,行数据也会重新调整大小,如果列的数据大于列,数据会中断并出现 3 个点。 问题是当我展开父行子网格时出现如上图。 。重新调整标题的大小,但数据不会改变它们的宽度。在过去的 3 天里,我正在努力寻找解决方案。
我将不胜感激任何形式的帮助。
【问题讨论】:
【参考方案1】:基于此解决方案http://forums.ext.net/showthread.php?13168&p=54291&viewfull=1#post54291,尝试将以下 CSS 添加到您的页面:
.x-grid .x-row-expander-control table
table-layout: fixed;
【讨论】:
这个问题应该在v2.5中修复。以上是关于Ext.net rowexpander 调整标题大小而不是调整内容大小的主要内容,如果未能解决你的问题,请参考以下文章