easysoft / zui

ZUI is an HTML5 front UI framework.
https://openzui.com
MIT License
2.71k stars 690 forks source link

datatable初始化 sort 参数 #79

Closed vision4fun closed 6 years ago

vision4fun commented 7 years ago

datatable初始化 sort 参数在 load 更新是会变成相反的

cols: [ { text: '用户名', flex: false, colClass: 'text-center' ,sort:false}, { text: '姓名', flex: false, colClass: 'text-center',sort:false }, { text: '部门', flex: false, colClass: 'text-center',sort:'up' }, { text: '操作', flex: false, colClass: 'text-center' ,sort:false} ] $('.user').datatable('load',function(data){console.log(data); return data;})

cols : Array(4) 0 : {text: "用户名", flex: false, colClass: "text-center", sort: false} 1 : {text: "姓名", flex: false, colClass: "text-center", sort: false} 2 : {text: "部门", flex: false, colClass: "text-center", sort: "down"} 3 : {text: "操作", flex: false, colClass: "text-center", sort: false} length : 4

vision4fun commented 7 years ago

就初始化的时候写down实际是up,反之也是。

catouse commented 7 years ago

已确定这是一个bug,你可以将 storage 选项设置为 false 来禁用自动应用排序规则。

vision4fun commented 7 years ago

临时的解决方案: 初始化的时候在 data 对象内增加一个 keepSort:true 的值