我有一个ngTable指令,当我有10个或更少的列时效果很好,但是当我添加第11个列时,表数据标签以错误的顺序显示,但不是数据本身。有没有人见过这个,有没有解决方案或解决方法?
这是一个能够准确显示我所看到的内容(你必须在Chrome中查看它才能在firefox中运行,即徒步旅行)
http://plnkr.co/edit/Kxo4zGnwz0mYshbd2SET?p=preview
var app = angular.module('main', ['ngTable'])
.controller('DemoCtrl', function($scope, $filter, NgTableParams) {
var data = [];
for (var row = 1; row <= 15; row++) {
var rowData = {};
for (var col = 1; col <= 15; col++) {
rowData["col" + col] = "value" + col;
}
data.push(rowData);
}
$scope.cols = [];
for(var column = 1; column <= 15; column++) {
var columnDef = {
title: 'Column ' + column,
show: true,
field: 'col' + column
};
$scope.cols.push(columnDef);
}
$scope.tableParams = new NgTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
filterDelay: 0,
total: data.length, // length of data
getData: function($defer, params) {
var result = data;
var filteredData = params.filter() ?
$filter('filter')(result, params.filter()) :
result;
var orderedData = params.sorting() ?
$filter('orderBy')(filteredData, params.orderBy()) :
result;
params.total(orderedData.length);
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});
});
移动的数据标签,无论内容如何,每次都是相同的,并且它们会被移动到同一位置。提前致谢