mardi 28 juillet 2015

Angularjs checkbox like gmail

Im newbie in angularjs. Now im having issues with a checkbox. First: my web are paging , sorting and change page size by call api to get data from server in factory:

this.getData = function(page , sortColumm, sortType , pageSize, searchText){
$http({
        method = get;
        url = "api/data?page="+page +"&sortColumm=" +sortColumm +"&sortType="+sortType +"&pagesize="+pageSize+"&search="+searchText;
    }).success(function (data) {
    }).error(function (error) {
    });
}

now i have a page using angularjs to bind data using funciton getData. html:

<thead>
    <tr>
        <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()"></th>
        <th>Administrator Name</th>
        <th >Administrator Type</th>
        <th>Roles</th>
    </tr>
</thead>
<tbody>
    <tr ng-repeat="gladmin in gladmins" ng-switch on="gladmin.isEnabled"
        on-finish-render="resizetable">
        <td><input type="checkbox" ng-model="gladmin.Selected" value="{{gladmin.id}}" ng-click="selectionAdmin(gladmin.id)"></td>
        <td><a href="javascript:void(0)" title="">{{gladmin.name}}</a></td>
        <td>{{gladmin.type}}</td>
    </tr>
</tbody>

controller

app.controller('adminPage',function(){
   // call getData
   $scope.checkAll=function(){
       // what should i write here?
       // i want check all is for current page, next page checkall = fall, 
       // same GMAIL
   }
   $scope.selectionAdmin = function(id){
       // what should i do here
   }
})

All i want is the checkall same the checkall in gmail ? anyone help me ? please, i am new bie in this!

i find some link here : http://ift.tt/1KwCeSL http://ift.tt/1lmEPlk

but it work not same i want !




1 commentaire: