forked from 0x2620/oxjs
correctly compute list height in Ox.List if horizontal scrolling is disabled in Ox.TableList
This commit is contained in:
parent
d16f76f0da
commit
39708edd8b
2 changed files with 21 additions and 7 deletions
|
|
@ -24,6 +24,7 @@ Ox.TableList <f> TableList Widget
|
|||
columnsResizable <b|false> If true, columns are resizable
|
||||
columnsVisible <b|false> If true, columns are visible
|
||||
columnWidth <[n]|[40, 800]> Minimum and maximum column width
|
||||
disableHorizontalScrolling <b|false> If true, disable scrolling
|
||||
draggable <b|false> If true, items can be dragged
|
||||
id <s|''> Id
|
||||
items <f|null> function() {} {sort, range, keys, callback} or array
|
||||
|
|
@ -107,10 +108,6 @@ Ox.TableList = function(options, self) {
|
|||
})
|
||||
.addClass('OxTableList');
|
||||
|
||||
if (!self.options.disableHorizontalScrolling) {
|
||||
enableHorizontalScrolling();
|
||||
}
|
||||
|
||||
self.options.columns.forEach(function(column) { // fixme: can this go into a generic ox.js function?
|
||||
// fixme: and can't these just remain undefined?
|
||||
if (Ox.isUndefined(column.align)) {
|
||||
|
|
@ -246,6 +243,7 @@ Ox.TableList = function(options, self) {
|
|||
|
||||
that.$body = Ox.List({
|
||||
construct: constructItem,
|
||||
disableHorizontalScrolling: self.options.disableHorizontalScrolling,
|
||||
draggable: self.options.draggable,
|
||||
id: self.options.id,
|
||||
itemHeight: 16,
|
||||
|
|
@ -306,6 +304,10 @@ Ox.TableList = function(options, self) {
|
|||
width: getItemWidth() + 'px'
|
||||
});
|
||||
|
||||
self.options.disableHorizontalScrolling
|
||||
? disableHorizontalScrolling()
|
||||
: enableHorizontalScrolling();
|
||||
|
||||
//Ox.Log('List', 's.vC', self.visibleColumns)
|
||||
|
||||
function addColumn(id) {
|
||||
|
|
@ -520,7 +522,10 @@ Ox.TableList = function(options, self) {
|
|||
}
|
||||
|
||||
function disableHorizontalScrolling() {
|
||||
that.$body.css({overflowX: 'hidden'});
|
||||
that.$body.options({
|
||||
disableHorizontalScrolling: true
|
||||
})
|
||||
.css({overflowX: 'hidden'});
|
||||
// fixme: is there a way to pass an array?
|
||||
that.unbindEvent('key_left').unbindEvent('key_right');
|
||||
}
|
||||
|
|
@ -627,7 +632,10 @@ Ox.TableList = function(options, self) {
|
|||
}
|
||||
|
||||
function enableHorizontalScrolling() {
|
||||
that.$body && that.$body.css({overflowX: 'auto'});
|
||||
that.$body.options({
|
||||
disableHorizontalScrolling: false
|
||||
})
|
||||
.css({overflowX: 'auto'});
|
||||
that.bindEvent({
|
||||
key_left: function () {
|
||||
var $element = that.$body.$element,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue