Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sir, i want to sort record display in gridview which is fill from database,When i enter any text in textbox gridview record sort according to text input in the text box. and when i clear textbox gridview show in his first condition when page is loaded first time.
Posted
Comments
[no name] 9-Oct-12 17:27pm    
Okay go ahead and do that. Since you did not ask a question you have my permission.
Jim Jos 9-Oct-12 21:22pm    
You can go back to database and do a sort on the input.. or you could have the recordset in the memory and sort..or you could sort the source of the gridview and reload. multiple ways to do this..
Santhosh Kumar Jayaraman 10-Oct-12 2:22am    
you want to do sort or filter?

1 solution

You need to define a custom text extraction function. It's not difficult:

http://tablesorter.com/docs/example-option-text-extraction.html[^]

then do this -

PHP
$("table.sortable").tablesorter({
  textExtraction: function(elem) {
    var $input = $("input[type=text]", elem);

    return $input.val() || $(elem).text();
  }
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900