add keys option to text list to allow for additional keys to be requested, beyond the keys of the visible columns

This commit is contained in:
rlx 2011-09-04 16:43:52 +00:00
parent 6adacf484f
commit 2aa828c308
2 changed files with 12 additions and 10 deletions

View file

@ -1658,6 +1658,7 @@ Ox.List = function(options, self) {
value <s> value, can be whatever that property is
@*/
that.value = function(id, key, value) {
Ox.print('that.value', id, getPositionById(id))
var pos = getPositionById(id),
$item = self.$items[pos],
data = $item.options('data'),

View file

@ -27,6 +27,7 @@ Ox.TextList <f:Ox.Element> TextList Object
draggable <b|false> If true, items can be dragged
id <s|''>
items <f|null> function() {} {sort, range, keys, callback} or array
keys <[s]|[]> Additional keys (apart from keys of visible columns)
max <n|-1> Maximum number of items that can be selected (-1 for all)
min <n|0> Minimum number of items that must be selected
pageLength <n|100> Number of items per page
@ -55,6 +56,7 @@ Ox.TextList = function(options, self) {
draggable: false,
id: '',
items: null, // function() {} {sort, range, keys, callback} or array
keys: [],
max: -1,
min: 0,
pageLength: 100,
@ -176,14 +178,13 @@ Ox.TextList = function(options, self) {
construct: constructItem,
draggable: self.options.draggable,
id: self.options.id,
items: self.options.items,
itemHeight: 16,
items: self.options.items,
itemWidth: getItemWidth(),
format: self.format, // fixme: not needed, happens in TextList
keys: $.map(self.visibleColumns, function(v) {
return v.id;
}),
keys: Ox.merge(self.visibleColumns.map(function(column) {
return column.id;
}), self.options.keys),
max: self.options.max,
min: self.options.min,
pageLength: self.options.pageLength,
@ -250,9 +251,9 @@ Ox.TextList = function(options, self) {
that.$head.$content.empty();
constructHead();
that.$body.options({
keys: $.map(self.visibleColumns, function(v, i) {
return v.id;
})
keys: Ox.merge(self.visibleColumns.map(function(column) {
return column.id;
}), self.options.keys)
});
that.$body.reloadPages();
}
@ -628,9 +629,9 @@ Ox.TextList = function(options, self) {
width: itemWidth + 'px'
});
that.$body.options({
keys: $.map(self.visibleColumns, function(v, i) {
return v.id;
})
keys: Ox.merge(self.visibleColumns.map(function(column) {
return colum.id;
}), self.options.keys)
});
//that.$body.clearCache();
}