如何基于select和checkbox标签进行过滤?

时间:2018-04-19 16:23:50

标签: javascript angular camunda camunda-modeler

我想制作过滤器,它可以帮助我根据它的优先级值组织我的表格数据(例如我有三个优先级值:非常重要,重要且不那么重要,而且我内部有三个选项值我的选择标签具有相同的名称,当我选择其中一个选择选项时,例如非常重要我应该在我的表中只看到这个具有此优先级的tr数据,我还需要使用主复选框输入来选择/不选择表格中显示的所有tr-s,这里是我的angular + javscrit代码,但在我的情况下,我不能只从我的表中选择过滤的tr-s而是我可以选择所有  该表中的数据:

$(document).ready(function($) {

    $('#mySelector').change( function(){
      var selection = $(this).val();
      $('table')[selection? 'show' : 'hide']();

      if (selection) {
        $.each($('#myTable tbody tr'), function(index, item) {
          $(item)[$(item).is(':contains('+ selection  +')')? 'show' : 'hide']();
        });
      }

    });
});
              <select> 
>            <option value='important'>აირჩიე</option>
>            <option value='very important'>very important</option>
>            <option value='middle important'>middle important</option>
>            <option value='not so important'>not so important</option>
>         </select>
>         </div>
>         </div>
>             </div>
>             <table name ="table" id="myTable" class="table table-hover  table-list-search" data-table="order-table" style="width:100%;" cellspacing="0">
>                 <thead>
>                     <tr>
>                         <th style="width:80px; height:25px;"><input style="width:25px; height:25px;" type="checkbox" id="checkAll" ng-click="selectAll()" /></th>
>                         
>                         <th style="width:140px;">id</th>
>                         <th style="width:305px;">organizationNameEN</th>
>                         <th style="width:305px;">organizationNameGE</th>
>                         <th style="width:305px;">priority</th>
>                          <th>&nbsp;</th>
>                     </tr>           
>                 </thead>
>                 <tbody ng-repeat="item in jsonData">
>                     <tr>
>                         <td><input type="checkbox" ng-change="sync(selected[item.id],item)"  ng-checked="isChecked(item.id)" name="checkData" ng-model="selected[item.id]" ng-false-value="undefined" /></td> 
>                 
>                         <td>{{item.id}}</td>
>                         <td>{{item.organizationNameEN}}</td>
>                          <td>{{item.organizationNameGE}}</td>   
>                          <td>{{item.priority}}</td>                   
>                          <td><button class="btn btn-default btn-xs" ng-click="toggle($index)"><span class="glyphicon glyphicon-eye-open"></span></button></td>
> 
> 
>         </tr>    

任何想法我怎么能以角度实现这个逻辑(我的意思是选择过滤器)? 当我像这样提交表格时:enter image description here

我想在主复选框clikc上只选择选定的值并将此数据放入selectedDocuments, 我应该如何实现这个逻辑? 以下是我感兴趣的几个主题:

  1. 有没有更好的方法来制作camunda形式的管道? 2.我可以只列出那些能见度不高或者不好的tr-s值吗?

0 个答案:

没有答案
相关问题