Trying to implement a filter on XML using jQuery. The filtered results are showing based on the condition, but facing difficulty in displaying all XML items when the flag is set to 0; meaning that when the flag is zero, all XML items should be displayed without any filtering.
JS script:
$(xml).find("TechJobSite").filter(function () {
if(jobFlagview==0) // Issue here - Need to remove the filter to show all job lists
return ;
else if(jobFlagview==1) // My Jobs
return $(this).find("AssignedRepairerUserName").text() == userId;
else if(jobFlagview==2) // Review
return $(this).find("Status").text() == "Draft";
}).each(function () {