adding functionality for textlist

This commit is contained in:
rlx 2011-01-06 03:10:40 +00:00
parent eabe90526f
commit 2d36700f58
4 changed files with 61 additions and 42 deletions

View File

@ -208,7 +208,7 @@ Lists
.OxThemeClassic .OxTextList .OxItem .OxCell {
border-right: 1px solid rgb(224, 224, 224);
border-right-color: rgb(224, 224, 224);
}
.OxThemeClassic .OxTextList .OxItem:nth-child(odd) {
background: rgb(242, 242, 242);

View File

@ -859,7 +859,7 @@ Lists
float: left;
position: absolute;
left: 0;
top: 16px;
top: 0;
right: 0;
bottom: 0;
overflow-y: scroll;
@ -874,11 +874,16 @@ Lists
.OxTextList .OxBody .OxItem .OxCell {
float: left;
height: 14px;
padding: 2px 4px 0 4px;
padding: 1px 4px 1px 4px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.OxTextList .OxBody .OxItem .OxCell > img {
width: 16px;
height: 16px;
margin: -1px 0 0 -4px;
}
.OxTextList .OxBody .OxItem .OxSpace {
float: left;
width: 4px;

View File

@ -186,7 +186,7 @@ Lists
.OxThemeModern .OxTextList .OxItem .OxCell {
border-right: 1px solid rgb(32, 32, 32);
border-right-color: rgb(32, 32, 32);
}
.OxThemeModern .OxTextList .OxItem:nth-child(odd) {
background: rgb(14, 14, 14);

View File

@ -6512,10 +6512,13 @@ requires
Ox.print('---- self.$pages', self.$pages)
++counter == 2 && !Ox.isUndefined(callback) && callback();
};
// fixme: find out which option is better
loadPage(page, function() {
loadPage(page - 1, fn);
loadPage(page + 1, fn);
//loadPage(page - 1, fn);
//loadPage(page + 1, fn);
});
loadPage(page - 1, fn);
loadPage(page + 1, fn);
}
function mousedown(e) {
@ -6529,10 +6532,10 @@ requires
if (!self.clickTimeout) {
// click
pos = $item.data('position');
if (e.metaKey && self.options.max == -1) {
if (!isSelected(pos)) {
if (e.metaKey) {
if (!isSelected(pos) && self.options.max == -1) {
addToSelection(pos);
} else {
} else if (self.options.min == 0) {
deselectTimeout = true;
}
} else if (e.shiftKey && self.options.max == -1) {
@ -6937,17 +6940,20 @@ requires
})
.options(options || {});
$.each(self.options.data, function(k, v) {
// make a clone, so we don't format cached data
self.data = $.extend({}, self.options.data);
$.each(self.data, function(k, v) {
var format = self.options.format[k];
if (Ox.isArray(v)) {
self.options.data[k] = v.join(', ');
self.data[k] = v.join(', ');
} else if (format) {
self.options.data[k] = Ox['format' + Ox.toTitleCase(format.type)]
self.data[k] = Ox['format' + Ox.toTitleCase(format.type)]
.apply(this, $.merge([v], format.args));
}
});
that.$element = self.options.construct(self.options.data)
that.$element = self.options.construct(self.data)
.addClass('OxItem')
.attr({
id: self.options.id
@ -6974,6 +6980,7 @@ requires
columnsMovable: false,
columnsRemovable: false,
columnsResizable: false,
columnsVisible: false,
columnWidth: [40, 800],
format: [],
id: '',
@ -7018,32 +7025,34 @@ requires
// Head
that.$bar = new Ox.Bar({
orientation: 'horizontal',
size: 16
}).appendTo(that);
that.$head = new Ox.Container()
.addClass('OxHead')
.appendTo(that.$bar);
that.$head.$content.addClass('OxTitles');
constructHead();
if (self.options.columnsRemovable) {
that.$select = new Ox.Select({
id: self.options.id + 'SelectColumns',
items: $.map(self.options.columns, function(v, i) {
return {
checked: v.visible,
disabled: v.removable === false,
id: v.id,
title: v.title
}
}),
max: -1,
min: 1,
type: 'image'
})
.bindEvent('change', changeColumns)
.appendTo(that.$bar.$element);
if (self.options.columnsVisible) {
that.$bar = new Ox.Bar({
orientation: 'horizontal',
size: 16
}).appendTo(that);
that.$head = new Ox.Container()
.addClass('OxHead')
.appendTo(that.$bar);
that.$head.$content.addClass('OxTitles');
constructHead();
if (self.options.columnsRemovable) {
that.$select = new Ox.Select({
id: self.options.id + 'SelectColumns',
items: $.map(self.options.columns, function(v, i) {
return {
checked: v.visible,
disabled: v.removable === false,
id: v.id,
title: v.title
}
}),
max: -1,
min: 1,
type: 'image'
})
.bindEvent('change', changeColumns)
.appendTo(that.$bar.$element);
}
}
// Body
@ -7067,11 +7076,15 @@ requires
unique: self.unique
}, $.extend({}, self)) // pass event handler
.addClass('OxBody')
.css({
top: (self.options.columnsVisible ? 16 : 0) + 'px',
overflowY: (self.options.columnsVisible ? 'scroll' : 'auto')
})
.scroll(function() {
var scrollLeft = $(this).scrollLeft();
if (scrollLeft != self.scrollLeft) {
self.scrollLeft = scrollLeft;
that.$head.scrollLeft(scrollLeft);
that.$head && that.$head.scrollLeft(scrollLeft);
}
})
.bindEvent({
@ -7234,10 +7247,11 @@ requires
var $cell = $('<div>')
.addClass('OxCell OxColumn' + Ox.toTitleCase(v.id))
.css({
width: (self.columnWidths[i] - 9) + 'px',
width: (self.columnWidths[i] - (self.options.columnsVisible ? 9 : 8)) + 'px',
borderRightWidth: (self.options.columnsVisible ? 1 : 0) + 'px',
textAlign: v.align
})
.html(!$.isEmptyObject(data) && data[v.id] ? data[v.id] : '')
.html(v.id in data ? data[v.id] : '')
.appendTo($item);
});
return $item;