ng-table分组不起作用

时间:2015-10-28 16:21:03

标签: grouping ngtable

我想在 ng-table 中使用分组数据,但是在控制台中没有工作且没有错误。 我从http://ng-table.com/#/grouping/demo-grouping-basic开始关注,并且不知道 simpleList 的数据!



demoApp.controller('demoController', function($scope, NgTableParams) {

      $scope.testData = [{
        name: 'john',
        age: 50
      }, {
        name: 'albert',
        age: 25
      }];

      $scope.tableParams = new NgTableParams({
        // initial grouping
        group: "name"
      }, {
        dataset: $scope.testData
      });
    }

<div class="row">
  <div class="col-md-6">
    <h3>ngTable directive</h3>
    <table ng-table="tableParamsPostCnt" class="table table-condensed table-bordered table-hover">
      <colgroup>
        <col width="30%" />
      </colgroup>

      <tr class="ng-table-group" ng-repeat-start="group in $groups">
        <td colspan="3">
          <a href="" ng-click="group.$hideRows = !group.$hideRows">
            <span class="glyphicon" ng-class="{ 'glyphicon-chevron-right': group.$hideRows, 'glyphicon-chevron-down': !group.$hideRows }"></span>
            <strong>{{ group.value }}</strong>
          </a>
        </td>
      </tr>

      <tr ng-hide="group.$hideRows" ng-repeat="user in group.data" ng-repeat-end>
        <td sortable="'name'" data-title="'name'" groupable="'name'" ng-if="false">
          {{user.name}}
        </td>
      </tr>

    </table>
  </div>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:-1)

                    

  

    To https://github.com/devilape/Iimpacttest.git
     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to 'https://github.com/devilape/Iimpacttest.git'
    hint: Updates were rejected because the tip of your current branch is behind
     hint: its remote counterpart. Integrate the remote changes (e.g.
     hint: 'git pull ...') before pushing again.
     hint: See the 'Note about fast-forwards' in 'git push --help' for details.