请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

QYJ39

注册会员

4

主题

7

帖子

55

积分

注册会员

积分
55
QYJ39
注册会员   /  发表于:2020-1-7 09:17  /   查看:2649  /  回复:1
本帖最后由 QYJ39 于 2020-1-8 13:08 编辑

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

1 个回复

倒序浏览
AlexZ讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2020-1-7 22:08:24
推荐
本帖最后由 AlexZ 于 2020-1-7 22:16 编辑

请参考下面的代码

  1. // expose data as a CollectionView to get events
  2.   $scope.data = new wijmo.collections.CollectionView(data);
  3.   $scope.data.sortDescriptions.push(new wijmo.collections.SortDescription('sales','true'));

  4.   
  5.   $scope.sort = function() {
  6.           $scope.data.sortDescriptions.clear();
  7.     $scope.data.sortDescriptions.push(new wijmo.collections.SortDescription('country','true'));
复制代码
  1. //create CollectionView
  2.   var cv = new wijmo.collections.CollectionView(data);
  3.   //add the column to be sorted by creating an object of SortDescription
  4.   // we are sorting country column in ascending order
  5.   cv.sortDescriptions.push(new wijmo.collections.SortDescription("country", 'true'));
  6.   //set the datasource
  7.   grid.itemsSource = cv;
复制代码

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部