From c496ec3abb87b96d95403b475858438beb15fe3b Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 5 Sep 2010 23:17:16 +0200 Subject: [PATCH] fix for column resize after column add/remove --- build/js/ox.ui.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index afec0d6..2ba8090 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -6529,6 +6529,7 @@ requires }); column.visible = true; self.visibleColumns.splice(index, 0, column); + self.columnWidths.splice(index, 0, column.width); that.$head.$content.empty(); constructHead(); that.$body.options({ @@ -6770,6 +6771,7 @@ requires Ox.print('removeColumn', id); var className = '.OxColumn' + Ox.toTitleCase(id), index = getColumnIndexById(id), + itemWidth, position = getColumnPositionById(id), $column = $('.OxTitle' + className), $order = $column.next(), @@ -6777,10 +6779,9 @@ requires self.options.columns[index].visible = false; self.visibleColumns.splice(position, 1); self.columnWidths.splice(position, 1); + that.$head.$content.empty(); + constructHead(); itemWidth = getItemWidth(); - $column.remove(); - $order.remove(); - $resize.remove(); $.each(that.$body.find('.OxItem'), function(i, v) { var $v = $(v); $v.children(className).remove(); @@ -6805,6 +6806,7 @@ requires function resizeColumn(id, width) { var i = getColumnIndexById(id), pos = getColumnPositionById(id); + self.visibleColumns[pos].width = width; self.columnWidths[pos] = width; that.$head.$content.css({ width: (Ox.sum(self.columnWidths) + 2) + 'px'