lundi 30 mars 2015

Exclude particular row from each loop based on Class Name

How to exclude a particular row based on its class-name using Jquery.



filterBySensor= function (event) {

j("#example tr").hide(); //hide all rows
j("#example tr:first").show();

var snsrname = j("#ulsensor option:selected").text(); //retrieve wanted status

if(snsrname == "All")
j("#example tr").show(); //show all rows if want to see All
else {
j("#example tr").each(function() { //loop over each row
var celldata = j.trim(j(this).find("td:eq(4)").text());
if(celldata == snsrname) { //check value of TD
j(this).show(); //show the row
}
});
}
}


The above code works perfectly and checks every row in the table. But I want to exclude some rows based on its classname. For example: There are 3 rows with classname GROUP and I need to exclude them from loop. Any help will be appreciated. Thanx in advance


Aucun commentaire:

Enregistrer un commentaire