我使用 nggrid 进行数据表示,其中一列保存地址,有时是多行且很长。我希望我的行是多行,其大小取决于地址分布的行数。我怎样才能有一个可编辑的行。我正在使用 nggrid 2.012
"devDependencies": {
"ng-grid": "~2.0.12"
}
我已经实现了分页
$scope.gridOptions = {
data: 'myData',
enablePaging: true,
showFooter: true,
totalServerItems: 'totalServerItems',
pagingOptions: $scope.pagingOptions,
filterOptions: $scope.filterOptions,
plugins: [new ngGridFlexibleHeightPlugin()],
columnDefs: [{field:'client_order_id', displayName:'Order Id'}, {field:'customer_name',displayName:'Customer Name'},
{field:'customer_phone', displayName:'Phone Number'},{field:'address', displayName:'Address'}]
};
以下是我目前的看法
<section data-ng-controller="OrdersController" data-ng-init="find()">
<div class="page-header">
<h1>Orders</h1>
</div>
<div class="gridStyle" ng-grid="gridOptions"/></div>
</section>
还想要多行地址
最佳答案
另一种常见的方法是当鼠标悬停在单元格上时显示带有整个长文本的工具提示:
columnDefs: [
{
field:'address',
displayName:'Address',
cellTemplate: '<div class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text title="{{COL_FIELD}}">{{COL_FIELD}}</span></div>'
}
]
关于javascript - 如何在nggrid中创建多行单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27733233/