IconList/InfoList/TextList: add query option
This commit is contained in:
parent
0f9bf79ddf
commit
68321c7245
3 changed files with 28 additions and 12 deletions
|
@ -18,6 +18,7 @@ Ox.IconList <f> IconList Object
|
||||||
min <n|0> minimum of selcted items
|
min <n|0> minimum of selcted items
|
||||||
orientation <s|both> orientation ("horizontal", "vertical" or "both")
|
orientation <s|both> orientation ("horizontal", "vertical" or "both")
|
||||||
pageLength <n|100> Number of items per page (if orientation != "both")
|
pageLength <n|100> Number of items per page (if orientation != "both")
|
||||||
|
query <o> Query
|
||||||
selected <a|[]> array of selected items
|
selected <a|[]> array of selected items
|
||||||
size <n|128> list size
|
size <n|128> list size
|
||||||
sort <a|[]> sort keys
|
sort <a|[]> sort keys
|
||||||
|
@ -44,6 +45,7 @@ Ox.IconList = function(options, self) {
|
||||||
min: 0,
|
min: 0,
|
||||||
orientation: 'both',
|
orientation: 'both',
|
||||||
pageLength: 100,
|
pageLength: 100,
|
||||||
|
query: {conditions: [], operator: '&'},
|
||||||
selected: [],
|
selected: [],
|
||||||
size: 128,
|
size: 128,
|
||||||
sort: [],
|
sort: [],
|
||||||
|
@ -52,14 +54,17 @@ Ox.IconList = function(options, self) {
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
.update({
|
.update({
|
||||||
items: function() {
|
items: function() {
|
||||||
that.$element.options('items', self.options.items);
|
that.$element.options({items: self.options.items});
|
||||||
|
},
|
||||||
|
query: function() {
|
||||||
|
that.$element.options({query: self.options.query});
|
||||||
},
|
},
|
||||||
selected: function() {
|
selected: function() {
|
||||||
that.$element.options('selected', self.options.selected);
|
that.$element.options({selected: self.options.selected});
|
||||||
},
|
},
|
||||||
sort: function() {
|
sort: function() {
|
||||||
updateKeys();
|
updateKeys();
|
||||||
that.$element.options('sort', self.options.sort);
|
that.$element.options({sort: self.options.sort});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -89,6 +94,7 @@ Ox.IconList = function(options, self) {
|
||||||
min: self.options.min,
|
min: self.options.min,
|
||||||
orientation: self.options.orientation,
|
orientation: self.options.orientation,
|
||||||
pageLength: self.options.pageLength,
|
pageLength: self.options.pageLength,
|
||||||
|
query: self.options.query,
|
||||||
selected: self.options.selected,
|
selected: self.options.selected,
|
||||||
sort: self.options.sort,
|
sort: self.options.sort,
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
|
|
|
@ -20,6 +20,7 @@ Ox.InfoList = function(options, self) {
|
||||||
keys: [],
|
keys: [],
|
||||||
max: -1,
|
max: -1,
|
||||||
min: 0,
|
min: 0,
|
||||||
|
query: {conditions: [], operator: '&'},
|
||||||
selected: [],
|
selected: [],
|
||||||
size: 192,
|
size: 192,
|
||||||
sort: [],
|
sort: [],
|
||||||
|
@ -28,14 +29,17 @@ Ox.InfoList = function(options, self) {
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
.update({
|
.update({
|
||||||
items: function() {
|
items: function() {
|
||||||
that.$element.options('items', self.options.items);
|
that.$element.options({items: self.options.items});
|
||||||
|
},
|
||||||
|
query: function() {
|
||||||
|
that.$element.options({query: self.options.query});
|
||||||
},
|
},
|
||||||
selected: function() {
|
selected: function() {
|
||||||
that.$element.options('selected', self.options.selected);
|
that.$element.options({selected: self.options.selected});
|
||||||
},
|
},
|
||||||
sort: function() {
|
sort: function() {
|
||||||
updateKeys();
|
updateKeys();
|
||||||
that.$element.options('sort', self.options.sort);
|
that.$element.options({sort: self.options.sort});
|
||||||
},
|
},
|
||||||
width: function() {
|
width: function() {
|
||||||
var width = getItemWidth();
|
var width = getItemWidth();
|
||||||
|
@ -45,7 +49,6 @@ Ox.InfoList = function(options, self) {
|
||||||
$parent.css({width: width - 144});
|
$parent.css({width: width - 144});
|
||||||
$parent.parent().css({width: width - 144});
|
$parent.parent().css({width: width - 144});
|
||||||
$parent.parent().parent().css({width: width - 8});
|
$parent.parent().parent().css({width: width - 8});
|
||||||
Ox.Log('List', '@@@', this.className, id)
|
|
||||||
Ox.UI.elements[id].options({width: width - 152});
|
Ox.UI.elements[id].options({width: width - 152});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -67,6 +70,7 @@ Ox.InfoList = function(options, self) {
|
||||||
min: self.options.min,
|
min: self.options.min,
|
||||||
orientation: 'vertical',
|
orientation: 'vertical',
|
||||||
pageLength: 10,
|
pageLength: 10,
|
||||||
|
query: self.options.query,
|
||||||
selected: self.options.selected,
|
selected: self.options.selected,
|
||||||
sort: self.options.sort,
|
sort: self.options.sort,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
|
|
|
@ -31,6 +31,7 @@ Ox.TextList <f> TextList Object
|
||||||
max <n|-1> Maximum number of items that can be selected (-1 for all)
|
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
|
min <n|0> Minimum number of items that must be selected
|
||||||
pageLength <n|100> Number of items per page
|
pageLength <n|100> Number of items per page
|
||||||
|
query <o> Query
|
||||||
scrollbarVisible <b|false> If true, the scrollbar is always visible
|
scrollbarVisible <b|false> If true, the scrollbar is always visible
|
||||||
selected <[s]|[]> Array of selected ids
|
selected <[s]|[]> Array of selected ids
|
||||||
sort <[o]|[s]|[]> ['+foo', ...] or [{key: 'foo', operator: '+'}, ...]
|
sort <[o]|[s]|[]> ['+foo', ...] or [{key: 'foo', operator: '+'}, ...]
|
||||||
|
@ -64,6 +65,7 @@ Ox.TextList = function(options, self) {
|
||||||
max: -1,
|
max: -1,
|
||||||
min: 0,
|
min: 0,
|
||||||
pageLength: 100,
|
pageLength: 100,
|
||||||
|
query: {conditions: [], operator: '&'},
|
||||||
scrollbarVisible: false,
|
scrollbarVisible: false,
|
||||||
selected: [],
|
selected: [],
|
||||||
sort: [],
|
sort: [],
|
||||||
|
@ -73,17 +75,20 @@ Ox.TextList = function(options, self) {
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
.update({
|
.update({
|
||||||
items: function() {
|
items: function() {
|
||||||
that.$body.options('items', self.options.items);
|
that.$body.options({items: self.options.items});
|
||||||
},
|
},
|
||||||
paste: function() {
|
paste: function() {
|
||||||
that.$body.options('paste', self.options.paste);
|
that.$body.options({paste: self.options.paste});
|
||||||
|
},
|
||||||
|
query: function() {
|
||||||
|
that.$body.options({query: self.options.query});
|
||||||
},
|
},
|
||||||
selected: function() {
|
selected: function() {
|
||||||
that.$body.options('selected', self.options.selected);
|
that.$body.options({selected: self.options.selected});
|
||||||
},
|
},
|
||||||
sort: function() {
|
sort: function() {
|
||||||
updateColumn();
|
updateColumn();
|
||||||
that.$body.options('sort', self.options.sort);
|
that.$body.options({sort: self.options.sort});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.addClass('OxTextList')
|
.addClass('OxTextList')
|
||||||
|
@ -226,9 +231,10 @@ Ox.TextList = function(options, self) {
|
||||||
}).concat(self.options.keys),
|
}).concat(self.options.keys),
|
||||||
max: self.options.max,
|
max: self.options.max,
|
||||||
min: self.options.min,
|
min: self.options.min,
|
||||||
|
orientation: 'vertical',
|
||||||
pageLength: self.options.pageLength,
|
pageLength: self.options.pageLength,
|
||||||
paste: self.options.paste,
|
paste: self.options.paste,
|
||||||
orientation: 'vertical',
|
query: self.options.query,
|
||||||
selected: self.options.selected,
|
selected: self.options.selected,
|
||||||
sort: self.options.sort,
|
sort: self.options.sort,
|
||||||
sortable: self.options.sortable,
|
sortable: self.options.sortable,
|
||||||
|
|
Loading…
Reference in a new issue