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