From 2861954d3519b25d1619f8853598b09a57f6ea48 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 30 Nov 2011 17:35:50 +0100 Subject: [PATCH] fix bugs in Spreadsheet --- source/Ox.UI/js/Form/Ox.Spreadsheet.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Spreadsheet.js b/source/Ox.UI/js/Form/Ox.Spreadsheet.js index 2a7fef3d..14efff0d 100644 --- a/source/Ox.UI/js/Form/Ox.Spreadsheet.js +++ b/source/Ox.UI/js/Form/Ox.Spreadsheet.js @@ -32,9 +32,11 @@ Ox.Spreadsheet = function(options, self) { function addColumn(index) { self.options.columns.splice(index, 0, ''); - self.values = self.values.map(function(columns) { - return columns.splice(index, 0, 0); + Ox.print('sv', JSON.stringify(self.values)) + self.values.forEach(function(columns) { + columns.splice(index, 0, 0); }); + Ox.print('sv', JSON.stringify(self.values)) renderSpreadsheet(); } @@ -63,8 +65,8 @@ Ox.Spreadsheet = function(options, self) { function removeColumn(index) { self.options.columns.splice(index, 1); - self.values = self.values.map(function(columns) { - return columns.splice(index, 1); + self.values.forEach(function(columns) { + columns.splice(index, 1); }); renderSpreadsheet(); }