fix bugs in Spreadsheet

This commit is contained in:
rolux 2011-11-30 17:35:50 +01:00
parent 137944a1a7
commit 2861954d35

View file

@ -32,9 +32,11 @@ Ox.Spreadsheet = function(options, self) {
function addColumn(index) { function addColumn(index) {
self.options.columns.splice(index, 0, ''); self.options.columns.splice(index, 0, '');
self.values = self.values.map(function(columns) { Ox.print('sv', JSON.stringify(self.values))
return columns.splice(index, 0, 0); self.values.forEach(function(columns) {
columns.splice(index, 0, 0);
}); });
Ox.print('sv', JSON.stringify(self.values))
renderSpreadsheet(); renderSpreadsheet();
} }
@ -63,8 +65,8 @@ Ox.Spreadsheet = function(options, self) {
function removeColumn(index) { function removeColumn(index) {
self.options.columns.splice(index, 1); self.options.columns.splice(index, 1);
self.values = self.values.map(function(columns) { self.values.forEach(function(columns) {
return columns.splice(index, 1); columns.splice(index, 1);
}); });
renderSpreadsheet(); renderSpreadsheet();
} }