Sally
April 10, 2018, 2:05pm
1
I want to use select tags inside my form and after filetering by it’s value i should get only filtered values in my selectedDocuments array , i have made this in javascript but i want to implement this logic in angular cam-sdk-form
here is my javascript code:
//selection code
$(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']();
});
}
});
});
here is my html code:
> >
> <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> </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>
Any idea how can i implement this logic( i mean selection filter ) in angular?
when i fileter table like this:
i want to choose only selected value on main checkbox clikc and put this data in selectedDocuments,
how should i implement this logic inside my table?