在新的ngGrid(ui-Grid) rc版本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,但我目前真正需要的是列调整。
谢谢
i