Hi
I have a table and trying to filter using uiTableFilter plugin as given at: http://silverwareconsulting.com/index.cfm/2008/10/2/jquery-autofiltering-table
Here is JQuery Function:
<script type="text/javascript">
$(document).ready(function() {
$table = $("#myTable").tablesorter({widthFixed: true, widgets: ['zebra']});
FilterText = "";
ColumnArray = ["Country","Province/State"];
for (i=0;i<ColumnArray.length;i++) {
$("#myTable tbody tr").find("td:eq(" + i + ")").click( function() {
clickedText = $(this).text();
FilterText = ((FilterText == clickedText) ? "" : clickedText );
$.uiTableFilter( $table, FilterText, ColumnArray[i]);
});
}
});
</script>
Below is my View Code:
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th align="left">Transaction<br />ID</th>
<th align="left">Transaction<br />Date</th>
<th align="left">Name</th>
<th align="left">Email Address</th>
<th align="left">Products</th>
</tr>
</thead>
<tbody>
<% foreach (var item in Model) { %>
<tr id="<%= Html.Encode(item.TX_Id) %>">
<td><%= item.TX_Id %></td>
<td><%= String.Format("{0:g}", item.UpdatedOn) %></td>
<td><%= Html.Encode(item.AddressDetail.CustomerMaster.FullName()) %></td>
<td><%= Html.Encode(item.AddressDetail.Email) %></td>
<td><%= item.Document.Product.Name %></td>
</tr>
<% } %>
</tbody>
</table>
It is not hitting this line:
$("#myTable tbody tr").find("td:eq(" + i + ")").click( function() {
Thanks for all the responses.