标签:blog http io ar os java for sp 数据
嵌套Grid,光棍月大放送,不藏着掖着。实在写的不好,没脸藏啊~只考虑显示排序修改什么的都不管!
<f:TemplateField ColumnID="griditem" Hidden="true" RenderAsRowExpander="true"> <ItemTemplate> <div runat="server" id="divItem" class="expander"> </div> </ItemTemplate> </f:TemplateField>
F(‘<% =Grid1.ClientID%>‘).view.on(‘expandBody‘, function (rowNode, record, expandRow, eOpts) { //传到后台,参数为行ID,行绑定的数据ID F.customEvent(‘GridItem_‘ + rowNode.id + ‘_‘ + record.get(‘ItemId‘)); });
<f:Panel runat="server" ID="PanelGrid1" Height="0px" Hidden="false"> <Items> <f:Grid ID="Grid2" Width="200px" runat="server" ShowBorder="false" ShowGridHeader="true" ShowHeader="false" AllowColumnLocking="True"> <Columns> <f:TemplateField Width="60px" HeaderText="序号"> <ItemTemplate> <asp:Label runat="server" Text=‘<%# Container.DataItemIndex + 1 %>‘></asp:Label> </ItemTemplate> </f:TemplateField> <f:BoundField runat="server" HeaderText="身高" DataField="ShenGao" /> <f:BoundField runat="server" HeaderText="体重" DataField="TiZhong" /> <f:BoundField runat="server" HeaderText="血压低" DataField="XueYaDi" /> <f:BoundField runat="server" HeaderText="血压高" DataField="XueYaGao" /> </Columns> </f:Grid> </Items> </f:Panel>
F.ready(function () { F(‘<% =Grid2.ClientID%>‘).autoWidth = true; F(‘<% =Grid2.ClientID%>‘).autoHeight = true; F(‘<% =Grid2.ClientID %>‘).setWidth(F(‘<% =Grid1.ClientID %>‘).getWidth() - 100); });
function showgirdItme(rowid) { //选择行隐藏列的ID,rowid来自后台 var itemid = $(‘#‘ + rowid).find(‘div .expander‘).attr(‘id‘); //复制的HTML $(‘#‘ + itemid).html($(‘#<% =PanelGrid1.ClientID %>-innerCt‘).html()); }
F(‘<% =Grid1.ClientID%>‘).view.on(‘collapsebody‘, function (rowNode, record, expandRow, eOpts) { var itemid = $(‘#‘ + rowNode.id).find(‘div .expander‘).attr(‘id‘); $(‘#‘ + itemid).html(‘‘); });
if (e.EventArgument.IndexOf("GridItem_") >= 0) { string rowid = e.EventArgument.Split(‘_‘)[1].ToString(); string id = e.EventArgument.Split(‘_‘)[2].ToString(); DataTable table = GetDataTable(); DataRow[] drs = table.Select("Id = ‘" + id + "‘"); DataTable dt = new DataTable(); dt = table.Clone(); foreach (DataRow dr in drs) { //模拟数据 dt.Rows.Add(dr.ItemArray); dt.Rows.Add(dr.ItemArray); if (Convert.ToInt32(id)>102) { dt.Rows.Add(dr.ItemArray); dt.Rows.Add(dr.ItemArray); } } //绑定 Grid2.DataSource = dt; Grid2.DataBind(); //注意延迟方法 string sc = "window.setTimeout(function () {showgirdItme(‘" + rowid + "‘);},100);"; FineUI.PageContext.RegisterStartupScript(sc); }
标签:blog http io ar os java for sp 数据
原文地址:http://www.cnblogs.com/shiworkyue/p/4071242.html