add experimental CustomList and ColumnList
This commit is contained in:
parent
9a19de83aa
commit
15601552e7
2 changed files with 95 additions and 0 deletions
26
source/Ox.UI/js/List/ColumnList.js
Normal file
26
source/Ox.UI/js/List/ColumnList.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
/*@
|
||||
Ox.ColumnList <f> Column List Widget
|
||||
experimental
|
||||
@*/
|
||||
|
||||
Ox.ColumnList = function(options, self) {
|
||||
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
columns: [],
|
||||
item: {},
|
||||
items: [],
|
||||
list: 'table',
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
|
||||
})
|
||||
.addClass('OxColumnList');
|
||||
|
||||
return that;
|
||||
|
||||
};
|
69
source/Ox.UI/js/List/CustomList.js
Normal file
69
source/Ox.UI/js/List/CustomList.js
Normal file
|
@ -0,0 +1,69 @@
|
|||
'use strict';
|
||||
|
||||
/*@
|
||||
Ox.CustomList <f> Custom List Widget
|
||||
experimental
|
||||
@*/
|
||||
|
||||
Ox.CustomList = function(options, self) {
|
||||
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
draggable: false,
|
||||
item: null,
|
||||
itemHeight: 32,
|
||||
items: null,
|
||||
itemWidth: 256,
|
||||
keys: [],
|
||||
max: -1,
|
||||
min: 0,
|
||||
pageLength: 100,
|
||||
query: {conditions: [], operator: '&'},
|
||||
scrollbarVisible: false,
|
||||
selected: [],
|
||||
sort: [],
|
||||
sortable: false,
|
||||
sums: [],
|
||||
unique: ''
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
|
||||
})
|
||||
.addClass('OxCustomList');
|
||||
|
||||
self.$list = Ox.List({
|
||||
construct: function(data) {
|
||||
return self.options.item(data).addClass('OxTarget');
|
||||
},
|
||||
draggable: self.options.draggable,
|
||||
itemHeight: self.options.itemHeight,
|
||||
itemWidth: self.options.itemWidth
|
||||
- self.options.scrollbarVisible * Ox.UI.SCROLLBAR_SIZE,
|
||||
items: self.options.items,
|
||||
keys: self.options.keys.concat(self.options.unique),
|
||||
max: self.options.max,
|
||||
min: self.options.min,
|
||||
orientation: 'vertical',
|
||||
pageLength: self.options.pageLength,
|
||||
query: self.options.query,
|
||||
selected: self.options.selected,
|
||||
sort: self.options.sort,
|
||||
sortable: self.options.sortable,
|
||||
sums: self.options.sums,
|
||||
type: 'text',
|
||||
unique: self.options.unique
|
||||
})
|
||||
.css({
|
||||
top: 0,
|
||||
overflowY: (self.options.scrollbarVisible ? 'scroll' : 'hidden')
|
||||
})
|
||||
.bindEvent(function(data, event) {
|
||||
that.triggerEvent(event, data);
|
||||
})
|
||||
.appendTo(that);
|
||||
|
||||
return that;
|
||||
|
||||
};
|
Loading…
Reference in a new issue