frameworks/uki/src/uki-view/view/table/column.js in uki-1.0.1 vs frameworks/uki/src/uki-view/view/table/column.js in uki-1.0.2

- old
+ new

@@ -7,11 +7,11 @@ this._css = 'float:left;white-space:nowrap;text-overflow:ellipsis;'; this._inset = new Inset(3, 5); this.init = function() {}; - uki.addProps(this, ['position', 'css', 'formatter', 'label', 'resizable', 'maxWidth', 'minWidth', 'maxWidth']); + uki.addProps(this, ['position', 'css', 'formatter', 'label', 'resizable', 'maxWidth', 'minWidth', 'maxWidth', 'key']); this.template = function(v) { if (v === undefined) return this._template = this._template || uki.theme.template('table-cell'); this._template = v; return this; @@ -54,11 +54,12 @@ this._inset = Inset.create(i); }); this.render = function(row, rect, i) { this._prerenderedTemplate || this._prerenderTemplate(rect); - this._prerenderedTemplate[1] = this._formatter ? this._formatter(row[this._position], row) : row[this._position]; + var value = this._key ? uki.attr(row, this._key) : row[this._position]; + this._prerenderedTemplate[1] = this._formatter ? this._formatter(value, row) : value; return this._prerenderedTemplate.join(''); }; this.appendResizer = function(dom, height) { var resizer = uki.theme.dom('resizer', height); @@ -67,12 +68,12 @@ }; this.renderHeader = function(height) { this._className || this._initStylesheet(); var x = this.headerTemplate().render({ - data: '<div style="overflow:hidden;text-overflow:ellipsis;">' + this.label() + '</div>', - style: this._cellStyle(uki.dom.offset.boxModel ? height - 1 : height), + data: '<div style="overflow:hidden;text-overflow:ellipsis;*width:100%;height:100%;">' + this.label() + '</div>', + style: '*overflow-y:hidden;' + this._cellStyle(uki.dom.offset.boxModel ? height - 1 : height), className: this._className }); return x; }; @@ -100,10 +101,10 @@ }; this._initStylesheet = function() { if (!this._className) { uki.dom.offset.initializeBoxModel(); - this._className = 'uki-table-column-' + (++uki.dom.guid); + this._className = 'uki-table-column-' + (uki.guid++); var css = '.' + this._className + ' {width:' + this._clientWidth() + 'px;}'; this._stylesheet = uki.dom.createStylesheet(css); } }; }); \ No newline at end of file