本帖最后由 AlexZ 于 2020-1-7 22:16 编辑
请参考下面的代码
- // expose data as a CollectionView to get events
- $scope.data = new wijmo.collections.CollectionView(data);
- $scope.data.sortDescriptions.push(new wijmo.collections.SortDescription('sales','true'));
-
- $scope.sort = function() {
- $scope.data.sortDescriptions.clear();
- $scope.data.sortDescriptions.push(new wijmo.collections.SortDescription('country','true'));
复制代码- //create CollectionView
- var cv = new wijmo.collections.CollectionView(data);
- //add the column to be sorted by creating an object of SortDescription
- // we are sorting country column in ascending order
- cv.sortDescriptions.push(new wijmo.collections.SortDescription("country", 'true'));
- //set the datasource
- grid.itemsSource = cv;
复制代码
|