我想使用jQuery对一行datagridview的值检查值? [英] I want check value against values of one column of datagridview using jQuery?
本文介绍了我想使用jQuery对一行datagridview的值检查值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var sSearchTerm = $('#<%=txtSearch.ClientID%>').val(); //Get the search box value
if (sSearchTerm.length == 0) //if nothing is entered then show all the rows.
{
$("#<%=dgv_AcadamicYear.ClientID%> tr:has(td)").show();
return false;
}
//Iterate through all the td.
$("#<%=dgv_AcadamicYear.ClientID%> tr:has(td)").children().each(function () {
var cellText = $(this).text().toLowerCase();
if (cellText.indexOf(sSearchTerm.toLowerCase()) >= 0) //Check if data matches
{
$(this).parent().show();
iCounter++;
return true;
}
});
GridView所有列中的代码搜索值。我想在单个列中搜索,例如,StudentID是一列,我只在单列中搜索ID 1
Above code search value in all columns of GridView. I want to search in a single column say for example StudentID is a one column and I am searching for ID 1 in only single column
推荐答案
(' #<%= txtSearch.ClientID%>')。val(); // 获取搜索框值
if (sSearchTerm.length == 0 ) // 如果没有输入则显示所有行。
{
('#<%=txtSearch.ClientID%>').val(); //Get the search box value if (sSearchTerm.length == 0) //if nothing is entered then show all the rows. {
( #<%= dgv_AcadamicYear.ClientID%> tr:has(td))。show();
return false ;
}
// 遍历所有td。
("#<%=dgv_AcadamicYear.ClientID%> tr:has(td)").show(); return false; } //Iterate through all the td.
( #<%= dgv_AcadamicYear.ClientID%> tr:has(td) )。children()。each(function(){
var cellText =
("#<%=dgv_AcadamicYear.ClientID%> tr:has(td)").children().each(function () { var cellText =
这篇关于我想使用jQuery对一行datagridview的值检查值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文