Angularjs UI-Grid列排序

时间:2015-10-13 05:45:02

标签: angularjs angular-ui-grid

我正在使用angularjs ui-grid,它在桌面和移动设备上运行良好但是当我尝试在移动或可触摸设备上移动ui-grid列时,它们不会被移动。 这是我的plunkr

任何帮助将不胜感激。 以下是附上的代码。

<!doctype html>
<html ng-app="app">
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-touch.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-animate.js"></script>
        <script src="http://ui-grid.info/docs/grunt-scripts/csv.js"></script>
        <script src="http://ui-grid.info/docs/grunt-scripts/pdfmake.js"></script>
        <script src="http://ui-grid.info/docs/grunt-scripts/vfs_fonts.js"></script>
        <script src="http://ui-grid.info/release/ui-grid.js"></script>
        <link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">
        <link rel="stylesheet" href="main.css" type="text/css">
    </head>
    <body>
        <div ng-controller="MainCtrl">
            <div id="grid1" ui-grid="gridOptions" ui-grid-move-columns class="grid"></div>
        </div>
        <script src="app.js"></script>
    </body>
</html>

js文件代码是: -

var app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.moveColumns']);
app.controller('MainCtrl', ['$scope', function($scope) {
    $scope.gridOptions = {
        enableSorting: true,
        columnDefs: [{
            name: 'firstName',
            field: 'first-name'
        }, {
            name: '1stFriend',
            field: 'friends[0]'
        }, {
            name: 'city',
            field: 'address.city'
        }, {
            name: 'getZip',
            field: 'getZip()',
            enableCellEdit: false
        }],
        data: [{
            "first-name": "Cox",
            "friends": ["friend0"],
            "address": {
                street: "301 Dove Ave",
                city: "Laurel",
                zip: "39565"
            },
            "getZip": function() {
                return this.address.zip;
            }
        }]
    };

}]);

0 个答案:

没有答案