QYJ39 发表于 2020-1-7 09:17:07

flexgrid 怎么通过代码触发字段排序和取消字段排序

本帖最后由 QYJ39 于 2020-1-8 13:08 编辑

flexgrid 怎么通过代码触发字段排序和取消字段排序

AlexZ 发表于 2020-1-7 22:08:24

本帖最后由 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;
页: [1]
查看完整版本: flexgrid 怎么通过代码触发字段排序和取消字段排序