I am applying filter based on whether a record is active or not. There are basically three things 1)show all record 2)show active ones 3)show only those which are inactive
I can easily apply filtering for active or inactive using following code
<div ng-repeat="payhead in payHeadsList | filter:search">
<div style="float:left;width:65%" class="">
<span style="float:left;" class="BodyTxt3 ML1">Show</span>
<select
class="W2_Normal BodyTxt3 V4 ML1" style='float:left' id="selectPayHead"
ng-model="search.ph_active"
ng-options="a.value as a.name for a in payHeadOption"></select>
</span>
</div>
$scope.payHeadOption=[{name:"All Payhead",value:3},{name:"Active Payhead",value:1},{name:"Inactive Payhead",value:0}];
so on selecting Active Payhead/Inactive Payhead ,it filters out record with search.ph_active=0 or 1. But I need to show all records on selection of All Payhead. What is the way here?
If you use an empty string it's like you don't specify filter criteria at all so all elements are shown, my first thought was to use null but it looks like null would be an actual value to compare while empty string match all elements
{name:"All Payhead",value:''}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With