javascript - angularjs filter with multiple dropdowns -


i'm pulling data api , displays results in view. want achieve being able filter data out multiple parameters

web api

.controller('list_ctrl',function($scope,$http,$location){     $scope.loading=true;     $http.post('http://webapp.com/list.php').success(function(data){     $scope.complains=data     console.log(json.stringify(data));     $scope.loading=false;      } 

html

<div class="col-sm-9"> <table width="100%" border="0" cellspacing="2" cellpadding="2" class="table">   <tr>     <td width="6%"><strong>sort by</strong></td>     <td width="7%"><select name="select" ng-model="search">       <option value="$"></option>       <option value="recieved">recieved</option>       <option value="pending">pending</option>       <option value="solved">solved</option>     </select></td>     <td width="5%"><strong>region</strong></td>     <td width="10%"><select ng-model="region" >   <option value="" disabled> </option>   <option ng-repeat="item in complains | unique:'region'" value="{{item.region}}">{{item.region}}</option>  </select></td>     <td width="5%"><strong>district</strong></td>     <td width="10%"><select name="select2" ng-model="district" >       <option value="" disabled="disabled"> </option>       <option ng-repeat="item in complains | unique:'district'" value="{{item.district}}">{{item.district}}</option>     </select></td>     <td width="4%"><strong>route</strong></td>     <td width="53%"><select ng-model="route" >   <option value="" disabled> </option>   <option ng-repeat="item in complains | unique:'route'" value="{{item.route}}">{{item.route}}</option>  </select></td>   </tr>   <tr>     <td>&nbsp;</td>     <td colspan="7">&nbsp;</td>   </tr> </table>   <div align="center" ng-if="loading">   <img src="img/loader.gif" width="100" height="13" border="0" />  </div>         <table class="table table-striped table-hover">   <tr class="success">     <td><strong>customer name</strong></td>     <td><strong>account number</strong></td>     <td><strong>complaint type</strong></td>     <td><strong>date of complaint</strong></td>     <td><strong>status</strong></td>     <td><strong>options</strong></td>   </tr>   <tr ng-repeat="item in complains | orderby:'-id'">     <td><span ng-class="{'unread':item.view_status === 'unread'}">{{item.customer_name}}</span></td>     <td>{{item.account_number}}</td>     <td>{{item.complain_type}}</td>     <td>{{item.date_of_complain |date: 'dd mmmm yyyy'}}</td>     <td>{{item.complain_status}}</td>     <td><a ng-click="update_view(item)" href="#/complain_view/{{item.id}}">view</a> | <a ng-click="update_view(item)" href="#/reply/{{item.id}}">reply </a></td>   </tr>   </table>  </div> 

how apply filter can sort region, district , routes above html. this? thanks


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -