Better usage for relative column width:

- Columns with relative width specified in template are kept relative in resize
 - Columns with no width specified in template get any left over space (relative)
 - Columns with fixed width specified in template are kept fixed
These three together mean that if the user resizes the window or adds/removes columns, fixed columns don't change and any space is divided among relative columns.
This commit is contained in:
Nathan Gray
2013-10-02 12:43:30 +00:00
parent 6e8723361d
commit 29f8a562e2
4 changed files with 32 additions and 33 deletions

View File

@ -386,7 +386,7 @@ var et2_dataview = Class.extend({
// make column resizable
var enc_column = self.columnMgr.getColumnById(col.id);
et2_dataview_makeResizeable(column, function(_w) {
this.set_width(_w + "px");
this.set_width(this.relativeWidth ? (_w / self.columnMgr.totalWidth * 100) + "%" : _w + "px");
self.columnMgr.updated = true;
self.updateColumns();
}, enc_column);