Ox.ColumnList: add public 'sort' method
This commit is contained in:
parent
cdf49b0bbe
commit
86019a83fb
1 changed files with 8 additions and 0 deletions
|
@ -55,6 +55,7 @@ Ox.ColumnList = function(options, self) {
|
|||
items: i == 0 ? self.options.items : [],
|
||||
itemWidth: self.columnWidths[i],
|
||||
keys: self.options.columns[i].keys,
|
||||
// FIXME: undefined max will overwrite CustomList default
|
||||
max: self.options.columns[i].max,
|
||||
resize: self.options.resize,
|
||||
scrollbarVisible: true,
|
||||
|
@ -184,6 +185,13 @@ Ox.ColumnList = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
that.sort = function(id, sort) {
|
||||
var index = Ox.isNumber(id) ? id
|
||||
: Ox.getIndexById(self.options.columns, id);
|
||||
self.$lists[index].options({sort: sort});
|
||||
self.options.columns[index].sort = sort;
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
Loading…
Reference in a new issue