0
내 AngularJS 웹 앱에서 devexpress로 피벗을하고 있습니다. 특히, 나는 필드 선택자 인 을 사용하고있다 : https://js.devexpress.com/Demos/WidgetsGallery/Demo/PivotGrid/FieldChooser/AngularJS/Light/Devexpress AngularJS 피벗에 대한 동적 데이터 얻기
이 예제에서 정적 데이터가있다. 서버에서 가져와야합니다. 그래서, 나는 이것을 썼다.
$scope.testData = null;
$scope.pivotGridDataSource = new DevExpress.data.PivotGridDataSource({
fields: [{
caption: "Nome",
dataField: "fullName",
area: "row"
}, {
caption: "Country",
dataField: "country",
area: "column"
}, {
caption: "Count",
dataField: "countOne",
dataType: "number",
summaryType: "sum",
area: "data"
}],
store: $scope.testData
});
$scope.pivotGridOptions = {
allowSortingBySummary: true,
allowSorting: true,
allowFiltering: true,
showBorders: true,
dataSource: $scope.pivotGridDataSource,
fieldChooser: {
enabled: false
}
},
$scope.fieldChooserOptions = {
dataSource: $scope.pivotGridDataSource,
texts: {
allFields: "All",
columnFields: "Columns",
dataFields: "Data",
rowFields: "Rows",
filterFields: "Filter"
},
width: 400,
height: 400,
bindingOptions: {
layout: "layout"
}
};
// Now I call the function to retrieve data
$scope.getTestData =() => {
// I call the server and save the data
........
$scope.testData = result;
}
문제는 테이블을 호출 한 후에도 여전히 비어 있다는 것이다. "데이터 없음"이라고 쓰여 있습니다. 왜? 나는 또한 서버를 호출 한 후
$scope.pivotGridDataSource.load();
$scope.pivotGridDataSource.reload();
을 쓰려고 시도했지만 아직 작동하지 않습니다.