1
0
Fork 0
forked from 0x2620/oxjs

add an optional function to textlist columns that maps values to sort values

This commit is contained in:
rolux 2011-05-22 15:14:42 +02:00
commit a3c18e57b0
6 changed files with 34 additions and 16 deletions

View file

@ -6,7 +6,17 @@ Ox.TextList <f:Ox.Element> TextList Object
(options) -> <f> TextList Object
(options, self) -> <f> TextList Object
options <o> Options object
columns <a|[]>
columns <[o]|[]>
Fixme: There's probably more...
addable <b>
editable <b>
id <s>
removable <b>
operator <s> default sort operator
sort <f> function that maps values to sort values
title <s>
visible <b>
width <n>
columnsMovable <b|false>
columnsRemovable <b|false>
columnsResizable <b|false>
@ -48,8 +58,6 @@ Ox.TextList = function(options, self) {
.options(options || {})
.addClass('OxTextList');
Ox.print('Ox.TextList self.options', self.options)
self.options.columns.forEach(function(v) { // fixme: can this go into a generic ox.js function?
// fixme: and can't these just remain undefined?
if (Ox.isUndefined(v.align)) {
@ -713,7 +721,11 @@ Ox.TextList = function(options, self) {
toggleSelected(self.options.columns[self.selectedColumn].id);
}
}
that.$body.sortList(self.options.sort[0].key, self.options.sort[0].operator);
that.$body.sortList(
self.options.sort[0].key,
self.options.sort[0].operator,
self.options.columns[self.selectedColumn].sort
);
return that;
};