var form = $(this).attr('id').split('_')[1];
var filter = $('input#filter_'+form).val();
+ var cnum = 0;
$('table#table_'+form+' tbody tr').each(function(i,e){
if (filter.length) {
var td = $(this).find('td:nth-child(4)');
- if (td.text().toLowerCase().indexOf(filter) > -1)
- $(this).show();
- else {
+ if (td.text().toLowerCase().indexOf(filter) > -1) {
+ $(this).removeClass('t0').removeClass('t1').addClass('t'+cnum).show();
+ cnum = cnum ? 0 : 1;
+ } else {
if ($(this).find('input[type="checkbox"]').prop('checked')) {
toggle_checkbox(form, td);
}
$(this).hide();
}
} else {
- $(this).show();
+ $(this).removeClass('t0').removeClass('t1').addClass('t'+cnum).show();
+ cnum = cnum ? 0 : 1;
}
});
}
function filter_clear(e)
{
var form = $(this).attr('id').split('_')[1];
- $('div.jscode input.filter#filter_'+form).val('').change();
+ $('div.jscode input.filter#filter_'+form).val('').keyup();
}
$(function(){
- $('div.jscode input.filter').change(filter_change);
+ $('div.jscode input.filter').keyup(filter_change);
$('div.jscode img.filter').click(filter_clear);
});
</protect>