samedi 2 juillet 2016

How to exclude a column during fitering in JavaScript



I have a JavaScript (jquery) to filter output of my query. But wen try to filter output table, filter finds hidden column values.

I need to exclude this hidden column during filtering.

Here is the code:

var $rowsActiveUser = $('#ku_list tr');
$('#search_ku').keyup(function() {
 var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
  $rowsActiveUser.show().filter(function() {
  var text = $(this).text().replace(/s+/g, ' ').toLowerCase();
   return !~text.indexOf(val);
 }).hide();
});

and fiddle is here fiddle is here

If you filter "9c" u will see 2 output. One of is in hidden column, other is in MAC address column. I want to exclue hidden one in my filter process. How can I modify my script?


Aucun commentaire:

Enregistrer un commentaire