zoukankan      html  css  js  c++  java
  • checkbox全选

    <yyc:SmartGridView ID="gvInfo" runat='server' AutoGenerateColumns="False" AllowPaging="True"
                                        ContextMenuCssClass="RightMenu" OnPageIndexChanging="gvInfo_PageIndexChanging"
                                        MouseOverCssClass="OverRow" PageSize="10" Width="96%" DataKeyNames="TempletNo">
                                        <Columns>
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    <asp:CheckBox ID="chkall" runat="server" onclick="SelectAllItem(gvInfo,this)" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk" runat="server" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="TempletNo" HeaderText="序号" ItemStyle-HorizontalAlign="Center" />
                                            <asp:TemplateField HeaderText="模板描述" ItemStyle-HorizontalAlign="Center">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lbtnTempletText" runat="server" CommandArgument='<%#Eval("TempletNo") %>'
                                                        Text='<%#Eval("TempletText") %>' OnCommand="TempletText_Command"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="DeptName" HeaderText="诊断科室" ItemStyle-HorizontalAlign="Center" />
                                            <asp:BoundField DataField="Name" HeaderText="诊断医生" ItemStyle-HorizontalAlign="Center" />
                                            <asp:BoundField DataField="Dept" HeaderText="诊断科室ID" ItemStyle-HorizontalAlign="Center" />
                                            <asp:BoundField DataField="Doctor" HeaderText="诊断医生ID" ItemStyle-HorizontalAlign="Center" />
                                        </Columns>
                                        <EmptyDataTemplate>
                                            无记录。
                                        </EmptyDataTemplate>
                                        <HeaderStyle ForeColor="Black" BorderStyle="Double" />
                                        <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条&nbsp;&nbsp;&nbsp;&nbsp;第{2}页/共{3}页&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" />
                                        <PagerSettings Position="Top" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
                                            NextPageText="下一页" LastPageText="末页" />
                                    </yyc:SmartGridView>


    function SelectAllItem(table,checkAll)  //table为gridviewID, checkAll 为CheckBox控件
            {
                for(var i = 0; i < form1.elements.length; i++)
                {
                    var e = form1.elements[i];
                    if(e.type != null && e.type.toLowerCase() == "checkbox" && e.parentElement.parentElement.parentElement.parentElement.id==table.id)  //gridview里的所有checkbox是否全部选种
                    {
                        e.checked = checkAll.checked;
                    }
                }
            }
  • 相关阅读:
    2020-11-15(第十一周)助教周小结
    2020-11-08(第十周)助教周小结
    2020-11-01助教周小结(第九周)
    Template.
    OO第四单元总结
    OO第三单元总结
    OO第二单元总结
    OO第一单元总结
    AFO
    Codeforces Round #424 (Div. 2)
  • 原文地址:https://www.cnblogs.com/juan/p/1431620.html
Copyright © 2011-2022 走看看