Filtered table information is not saved on clicking next page

xnetterx

New Member
I am using a simple code in html to filter table column values which is working perfectly fine. Here is the code for that:\[code\]// Table Content Filtering$(document).ready(function () { $('select.ddlFilterTableRow').bind('change', function () { $('select.ddlFilterTableRow').attr('disabled', 'disabled'); $('#tableRegister').find('.Row').hide(); var critriaAttribute = ''; $('select.ddlFilterTableRow').each(function () { if ($(this).val() != '0') { critriaAttribute += '[data-' + $(this).data('attribute') + '="' + $(this).val() + '"]'; } }); $('#tableRegister').find('.Row' + critriaAttribute).show(); $('select.ddlFilterTableRow').removeAttr('disabled'); });});\[/code\]And i have given my table id as \[code\]tableRegister\[/code\], filter as such is working. Now when i add another javascript to add page numbers say 1 2 3 here is the code for that:\[code\]Pagination.js\[/code\]\[code\]$(document).ready(function () { var rows = $('table').find('tbody tr').length; var no_rec_per_page = 23; var no_pages = Math.ceil(rows / no_rec_per_page); var $pagenumbers = $('<div id="pages"></div>'); for (i = 0; i < no_pages; i++) { $('<span class="page">' + (i + 1) + '</span>').appendTo($pagenumbers); } $pagenumbers.insertAfter('table'); $('.page').hover( function () { $(this).addClass('hover'); }, function () { $(this).removeClass('hover'); }); $('table').find('tbody tr').hide(); var tr = $('table tbody tr'); for (var i = 0; i <= no_rec_per_page - 1; i++) { $(tr).show(); } $('span').click(function (event) { $('table').find('tbody tr').hide(); for (i = ($(this).text() - 1) * no_rec_per_page; i <= $(this).text() * no_rec_per_page - 1; i++) { $(tr).show(); } });});\[/code\]Now my problem is when i filter a column according to some value and i click the next page say 2 then come back again to page 1, the filtered information is not retained. What mistake am I making?
 
Back
Top