本帖最后由 leslieshenfang 于 2017-10-25 16:47 编辑
我在angular下使用flexgrid时,需要实现行高自适应,长中文自动换行的功能,已在列中设置 wordWrap="true",并在测试按钮中调用了autoSizeRows,但是依然没能实现行高,麻烦帮我看一下属性设置是不是正确?
HTML:
<div ng-app="app" ng-controller="appCtrl" class="container">
<p ng-click=btn()>自适应行高</p>
<wj-flex-grid items-source="data" initialized="init(s,e)" autoGenerateColumns="false" >
<wj-flex-grid-column header="Country" binding="country" wordWrap="true"></wj-flex-grid-column>
</wj-flex-grid>
</div>
JS:
var app = angular.module('app', ['wj']);
app.controller('appCtrl', function($scope) {
var countries = 'US,测试测试测试测试测试测试测试测试测试测试,UK,Japan,Italy,Greece'.split(','),
data = [];
for (var i = 0; i < countries.length; i++) {
data.push({
country: countries,
});
}
$scope.init = function (s, e) {
var flex = s;
$scope.flex1 = flex;
}
$scope.btn = function () {
$scope.flex1.autoSizeRows();
};
$scope.data = new wijmo.collections.CollectionView(data);
});
附件已上传,麻烦您帮我看一下
|