Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

_uiSetWidth needs to account for border width

This unfortunately breaks percentage widths for non-scrolling
tables, since the browser resize is not tracked in core.  The
initial paint should be fine, but resizing the browser won't
resize the table.

I need to move that logic from datatable-scroll to core, but
it'll have to wait for a future sprint :(
  • Loading branch information...
commit 06ef0d619dd00775d7c5761bc327aa409047c736 1 parent 490361c
@lsmith authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/datatable/js/core.js
View
11 src/datatable/js/core.js
@@ -1424,12 +1424,15 @@ Y.mix(Table.prototype, {
if (isString(width)) {
this._uiSetDim('width', width);
- // Table width needs to account for borders
- table.setStyle('width',
- (this.get('boundingBox').get('offsetWidth') -
+ if (width) {
+ // Table width needs to account for borders
+ width = (this.get('boundingBox').get('offsetWidth') -
(parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0) -
(parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0)) +
- 'px');
+ 'px';
+ }
+
+ table.setStyle('width', width);
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.