使用jquery在gridview中获取下拉列表值 [英] get dropdownlist values in the gridview using jquery

查看:89
本文介绍了使用jquery在gridview中获取下拉列表值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁可以告诉我如何在选中复选框时使用jquery获取gridview中的dropdownlist值?

i不知道怎么做。请帮助

who can tell me how to get get dropdownlist values in the gridview using jquery while checkbox is checked?
i have no idea how to do it.please help

推荐答案

< asp:gridview id =gv_orderStatusautogeneratecolumns =falseemptydatatext =查询无结果xmlns:asp =#unknown>

Border = 1pxAllowPaging =trueAllowSorting =falseOnRowDataBound =gv_orderStatus_RowDataBound

OnPageIndexChanging =gvPaging_PageIndexChangingWidth =100%PageSize =30runat =server>

<% - width =1200px - %>

< headerstyle height =25pxbackcolor =#CCCCFF>

< rowstyle horizo​​ntalalign =Centerfont-size =13pxforecolor =Blackheight =20px>

Width =100%/>

< columns> <% - < asp:boundfield datafield =option_nameheadertext =页面> - %>

< asp:templatefield controlstyle-width =200px>

<% - HeaderStyle-BackColor =#66CCFFHeaderStyle-BackColor =#CCCCFF - %>

< headertemplate>

< asp:label id =lbpageclass =ESB_Labeltext =页面runat =server>]]>



< itemtemplate>

<% - < asp:dropdownlist id =fullnamerunat =serverwidth =150px>

- % >

< asp:label id =fullnametext =<%#Eval(fullname)=%& gt;=runat =server >





<% - < asp:boundfield datafield =option_typeheadertext =类型sortexpression =option_typeheaderstyle-backcolor =#66CCFF> - %>

< asp:templatefield controlstyle-width =200px>

<% - HeaderStyle-BackColor =#66CCFF - %>

< headertemplate>

< asp:label id =lblTypeclass =ESB_Labeltext =类型runat =server>]]>



< itemtemplate>

< asp:label id =option_typewidth =120pxtext =<%#Eval( option_type)=%& gt;=runat =server>



< headerstyle horizo​​ntalalign =Center>

< itemstyle horizo​​ntalalign =Centerwidth =150px>



<% - < asp:boundfield datafield =option_nameheadertext =名称sortexpression =option_nameheaderstyle-backcolor =#66CCFF> - %>

< asp:templatefield controlstyle-width =130pxitemstyle-horizo​​ntalalign =Center>

<% - HeaderStyle-BackColor =#66CCFF - %>

< headertemplate>

< asp: label id =lblNametext =名称class =ESB_Labelrunat =server>



< itemtemplate>

< asp:textbox id =option_namewidth =100pxtext =<%#Bind(option_name)=%& gt;=cssclass =CC_TextBox_ReadOnly1>

runat =server>

< asp:label id =hidOption_nametext =runat =servervisible =falseforecolor =Red>



< itemstyle width =100pxhorizo​​ntalalign =Center>



<% - < asp:boundfield datafield =option_codeheadertext =编号sortexpression =option_codeheaderstyle-backcolor =#66CCFF> - %>

< asp:templatefield controlstyle-width = 100px>

<% - HeaderStyle-BackColor =#66CCFF - %>

< headertemplate>

< asp:label id =lblCodetext =编号class =ESB_Labelrunat =server>



< itemtemplate>

< asp:textbox id =option_codeclass =optionCodewidth =70pxcssclass =CC_TextBox_ReadOnly2>

Text =' <%#Bind(option_code)%>'runat =server>



< itemstyle horizo​​ntalalign =Right>



<% - < asp:boundfield datafield =option_orderheadertext =排序sortexpression =option_orderheaderstyle-backcolor =#66CCFF> - %>

< asp:templatefield controlstyle-width =100px>

<% - HeaderStyle-BackColor =#66CCFF - %> ;

< headertemplate>

< asp:label id =lblSorttext =排序class =ESB_L abelrunat =server>



< itemtemplate>

<% - < asp:label id = option_namerunat =server> - %>

< asp:textbox id =option_orderclass =optionOrderwidth =70pxcssclass =CC_TextBox_ReadOnly2>

Text ='<%#Bind(option_order)%>'Style =text-align:rightrunat =server>



< itemstyle horizo​​ntalalign =Left>



<% - < asp:boundfield datafield =flagheadertext =状态> - %>

< asp:templatefield controlstyle-width =100pxfooterstyle-horizo​​ntalalign =Center>

< headert emplate>

<% - HeaderStyle-BackColor =#66CCFF - %>

< asp:label id =lbStateclass =ESB_Label text =状态runat =server>



< itemtemplate>

< asp:dropdownlist id =flag class =flagrunat =servercssclass =ESB_Select_100>

Width =70px>

< asp:listitem text =Normal value =1>

< asp:listitem text =已结束值=0>







< asp:templatefield controlstyle-width =150px>

<% - HeaderStyle-BackColor =#66CCFF - %>

< headertemplate>

<% - < asp:checkbox id = selectAllrunat =serveroncheckedchanged =chkAll_CheckedChangedtext =SelectAll Or Cancel> - %>









< asp:label id =label1class =ESB_Labelrunat =server> SelectAll或Cancel

< % - < asp:label text =全选或取消class =ESB_Labelrunat =server> - %>



< ; itemtemplate>

< asp:checkbox id =CheckBox1width =60pxrunat =server>


<asp:gridview id="gv_orderStatus" autogeneratecolumns="false" emptydatatext="查询无结果" xmlns:asp="#unknown">
Border="1px" AllowPaging="true" AllowSorting="false" OnRowDataBound="gv_orderStatus_RowDataBound"
OnPageIndexChanging="gvPaging_PageIndexChanging" Width="100%" PageSize="30" runat="server">
<%--width="1200px"--%>
<headerstyle height="25px" backcolor="#CCCCFF">
<rowstyle horizontalalign="Center" font-size="13px" forecolor="Black" height="20px">
Width="100%" />
<columns> <%--<asp:boundfield datafield="option_name" headertext="页面">--%>
<asp:templatefield controlstyle-width="200px">
<%--HeaderStyle-BackColor="#66CCFF"HeaderStyle-BackColor="#CCCCFF"--%>
<headertemplate>
<asp:label id="lbpage" class="ESB_Label" text="页面" runat="server">]]>

<itemtemplate>
<%--<asp:dropdownlist id="fullname" runat="server" width="150px">
--%>
<asp:label id="fullname" text="<%# Eval(" fullname")="" %&gt;"="" runat="server">


<%-- <asp:boundfield datafield="option_type" headertext="类型" sortexpression="option_type" headerstyle-backcolor="#66CCFF">--%>
<asp:templatefield controlstyle-width="200px">
<%--HeaderStyle-BackColor="#66CCFF"--%>
<headertemplate>
<asp:label id="lblType" class="ESB_Label" text="类型" runat="server">]]>

<itemtemplate>
<asp:label id="option_type" width="120px" text="<%#Eval(" option_type")="" %&gt;"="" runat="server">

<headerstyle horizontalalign="Center">
<itemstyle horizontalalign="Center" width="150px">

<%-- <asp:boundfield datafield="option_name" headertext="名称" sortexpression="option_name" headerstyle-backcolor="#66CCFF">--%>
<asp:templatefield controlstyle-width="130px" itemstyle-horizontalalign="Center">
<%--HeaderStyle-BackColor="#66CCFF"--%>
<headertemplate>
<asp:label id="lblName" text="名称" class="ESB_Label" runat="server">

<itemtemplate>
<asp:textbox id="option_name" width="100px" text="<%#Bind(" option_name")="" %&gt;"="" cssclass="CC_TextBox_ReadOnly1">
runat="server">
<asp:label id="hidOption_name" text="" runat="server" visible="false" forecolor="Red">

<itemstyle width="100px" horizontalalign="Center">

<%--<asp:boundfield datafield="option_code" headertext="编号" sortexpression="option_code" headerstyle-backcolor="#66CCFF">--%>
<asp:templatefield controlstyle-width="100px">
<%--HeaderStyle-BackColor="#66CCFF"--%>
<headertemplate>
<asp:label id="lblCode" text="编号" class="ESB_Label" runat="server">

<itemtemplate>
<asp:textbox id="option_code" class="optionCode" width="70px" cssclass="CC_TextBox_ReadOnly2">
Text='<%#Bind("option_code")%>' runat="server">

<itemstyle horizontalalign="Right">

<%--<asp:boundfield datafield="option_order" headertext="排序" sortexpression="option_order" headerstyle-backcolor="#66CCFF">--%>
<asp:templatefield controlstyle-width="100px">
<%--HeaderStyle-BackColor="#66CCFF"--%>
<headertemplate>
<asp:label id="lblSort" text="排序" class="ESB_Label" runat="server">

<itemtemplate>
<%-- <asp:label id="option_name" runat="server">--%>
<asp:textbox id="option_order" class="optionOrder" width="70px" cssclass="CC_TextBox_ReadOnly2">
Text='<%#Bind("option_order") %>' Style="text-align: right" runat="server">

<itemstyle horizontalalign="Left">

<%-- <asp:boundfield datafield="flag" headertext="状态">--%>
<asp:templatefield controlstyle-width="100px" footerstyle-horizontalalign="Center">
<headertemplate>
<%--HeaderStyle-BackColor="#66CCFF"--%>
<asp:label id="lbState" class="ESB_Label" text="状态" runat="server">

<itemtemplate>
<asp:dropdownlist id="flag" class="flag" runat="server" cssclass="ESB_Select_100">
Width="70px">
<asp:listitem text="Normal" value="1">
<asp:listitem text="Closed" value="0">



<asp:templatefield controlstyle-width="150px">
<%--HeaderStyle-BackColor="#66CCFF"--%>
<headertemplate>
<%--<asp:checkbox id="selectAll" runat="server" oncheckedchanged="chkAll_CheckedChanged" text="SelectAll Or Cancel">--%>





<asp:label id="label1" class="ESB_Label" runat="server">SelectAll Or Cancel
<%-- <asp:label text="全选或取消" class="ESB_Label" runat="server">--%>

<itemtemplate>
<asp:checkbox id="CheckBox1" width="60px" runat="server">












你的问题毫无意义,因为没有例如浏览器中的gridview,只有服务器端控件生成的表。


Your question makes no sense, because there is no such thing as a gridview in the browser, only the table that your server side control generated.


(#whatever)。is(:checked)是如何判断是否选中了复选框。您需要使用过滤器来查找所有选中的复选框。您没有说您是否想要所选的值(我认为val()会这样做)或所有值。无论哪种方式,我不确定你知道什么是jquery或它做什么。更多信息会有所帮助。如果您尝试进行一些研究并发布一些基本代码会有所帮助,那么我们就可以确定您要做的事情。
("#whatever").is(":checked") is how you tell if a checkbox is checked. You need to use a filter to find all checked checkboxes. You don't say if you want the selected value ( I think val() does that ), or all values. Either way, I am not sure you know what jquery is or what it does. Some more information would help. It would help if you tried to do some research and could post some basic code, so we could work out what you are trying to do.


这篇关于使用jquery在gridview中获取下拉列表值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆