我似乎无法在新的 ngGrid (ui-Grid) rc build v3.0.0-rc.11 中进行任何分页或列大小调整。根据此示例,它应该非常简单:http: //ui-grid.info/docs/#/tutorial/401_AllFeatures
对于我的主 div,如果我这样做:
<div ui-grid="productGridOptions" ui-grid-resize-columns class="uiGridProducts">
在我的控制器中这样做:
$scope.productGridOptions={};
$scope.productGridOptions.enableColumnResizing = true;
$scope.productGridOptions.enableFiltering = false;
$scope.productGridOptions.enablePaging = true;
$scope.productGridOptions.pagingOptions = {
pageSizes: [250, 500, 1000],
pageSize: 250,
currentPage: 1
};
$scope.productGridOptions.rowIdentity = function(row) {
return row.id;
};
$scope.productGridOptions.getRowIdentity = function(row) {
return row.id;
};
$scope.productGridOptions.data = 'products';
//The options for the data table
$scope.productGridOptions.columnDefs = [
{ name:'ID', field: 'id' },
{ name:'Product', field: 'productName' },
{ name:'Active Ing.', field: 'activeIngredients'},
{ name:'Comments', field: 'comments' }
];
prProductService.getProducts().then(function(products) {
$scope.products = products;
});
分页或列大小调整都不起作用。ui-grid 教程中没有分页示例,因此假设它类似于 ngGrid,但它的列大小调整是我目前真正需要的。
问候
一世