Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 20, 2012 11:02 AM by asteranup
Participant
840 Points
1042 Posts
Aug 18, 2012 10:28 AM|LINK
hi all,
1. i bind some records on gridview control(with 10 columns).
2. top of the gridview for 2 columns, i have input controls to find greater, smaller or equal to data based on user input,
3. after selected the symbol(<,>,=) it has to filter the rows based on point 2.
simply i want to filter the gridview rows by jquery.
Aug 20, 2012 03:51 AM|LINK
any idea would be appreciated.
All-Star
30184 Points
4906 Posts
Aug 20, 2012 05:07 AM|LINK
Hi,
You can have some idea here-
http://forums.asp.net/p/1699714/4506507.aspx/1?Re+Set+table+columns+invisible+is+it+possible
http://delicious.com/anupdg/filter
22367 Points
2704 Posts
Microsoft
Aug 20, 2012 05:30 AM|LINK
Hello
You can iterate all rows to find the data. Based on user's input, compare one by one to see if the row has the data that meets the requirement.
In jQuery, you'll try find the row by each method, http://api.jquery.com/each/
$('#YourGridViewId td').each(function () {
// compare data.
});
Aug 20, 2012 06:18 AM|LINK
asteranup Hi, You can have some idea here- http://forums.asp.net/p/1699714/4506507.aspx/1?Re+Set+table+columns+invisible+is+it+possible http://delicious.com/anupdg/filter
thanks for your response.
this is excellent. now i got some idea. one small doubt on here
$("table[id*=gv] tr:has('span')").each(function () { if ($(this).find("span[id*=title]:contains(" + test + ")").length == 0) $(this).hide(); });
above line(bold) we are specifying column name, may i know how do we specify the column number?
Aug 20, 2012 06:29 AM|LINK
winseealn@hotmail.com if ($(this).find("span[id*=title]:contains(" + test + ")").length == 0)
Try this-
if ($(this).find("td:eq(2):contains(" + test + ")").length == 0)
This check third column of the row.
Aug 20, 2012 10:20 AM|LINK
got the idea. finally only one doubt: among the gridview rows how do we find whether the row status is hide() or show()?
Aug 20, 2012 11:02 AM|LINK
You can use hidden selector for this-
http://api.jquery.com/hidden-selector/
But there is one more way. While starting search first make all the row to display block and then search and hide.
winseealn@ho...
Participant
840 Points
1042 Posts
jquery filter row
Aug 18, 2012 10:28 AM|LINK
hi all,
1. i bind some records on gridview control(with 10 columns).
2. top of the gridview for 2 columns, i have input controls to find greater, smaller or equal to data based on user input,
3. after selected the symbol(<,>,=) it has to filter the rows based on point 2.
simply i want to filter the gridview rows by jquery.
winseealn@ho...
Participant
840 Points
1042 Posts
Re: jquery filter row
Aug 20, 2012 03:51 AM|LINK
any idea would be appreciated.
asteranup
All-Star
30184 Points
4906 Posts
Re: jquery filter row
Aug 20, 2012 05:07 AM|LINK
Hi,
You can have some idea here-
http://forums.asp.net/p/1699714/4506507.aspx/1?Re+Set+table+columns+invisible+is+it+possible
http://delicious.com/anupdg/filter
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: jquery filter row
Aug 20, 2012 05:30 AM|LINK
Hello
You can iterate all rows to find the data. Based on user's input, compare one by one to see if the row has the data that meets the requirement.
In jQuery, you'll try find the row by each method, http://api.jquery.com/each/
$('#YourGridViewId td').each(function () {
// compare data.
});
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
winseealn@ho...
Participant
840 Points
1042 Posts
Re: jquery filter row
Aug 20, 2012 06:18 AM|LINK
thanks for your response.
http://forums.asp.net/p/1699714/4506507.aspx/1?Re+Set+table+columns+invisible+is+it+possible
this is excellent. now i got some idea. one small doubt on here
$("table[id*=gv] tr:has('span')").each(function () {
if ($(this).find("span[id*=title]:contains(" + test + ")").length == 0)
$(this).hide();
});
above line(bold) we are specifying column name, may i know how do we specify the column number?
asteranup
All-Star
30184 Points
4906 Posts
Re: jquery filter row
Aug 20, 2012 06:29 AM|LINK
Hi,
Try this-
if ($(this).find("td:eq(2):contains(" + test + ")").length == 0)This check third column of the row.
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
winseealn@ho...
Participant
840 Points
1042 Posts
Re: jquery filter row
Aug 20, 2012 10:20 AM|LINK
thanks for your response.
got the idea. finally only one doubt: among the gridview rows how do we find whether the row status is hide() or show()?
asteranup
All-Star
30184 Points
4906 Posts
Re: jquery filter row
Aug 20, 2012 11:02 AM|LINK
Hi,
You can use hidden selector for this-
http://api.jquery.com/hidden-selector/
But there is one more way. While starting search first make all the row to display block and then search and hide.
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog