Commit 276fdc96 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

convert jQuery.sheet's complex data to simple 2D array in UI code.

so that the output format is stable even if we use another spreadsheet implementation.
parent 05cfe2eb
......@@ -247,11 +247,21 @@
});
nodes[node_id] = clone_node;
});
// convert jQuery.sheet's complex data to simple 2D array
var rows = [];
if (data['spreadsheet']) {
$.each(data['spreadsheet'][0]['rows'], function (i, row) {
var columns = [];
$.each(row['columns'], function (j, column) {
columns.push(column['value'] || null);
});
rows.push(columns);
});
};
manpy_dict['nodes'] = nodes;
manpy_dict['edges'] = data['edges'];
manpy_dict['general'] = data['general'];
manpy_dict['spreadsheet'] = data['spreadsheet'];
manpy_dict['spreadsheet'] = rows;
return manpy_dict;
};
......
......@@ -5,8 +5,7 @@ class Simulation(DefaultSimulation):
def run(self, data):
if 'spreadsheet' in data:
wip_dict = {}
for row in data['spreadsheet'][0]['rows']:
value_list = [x.get('value') for x in row['columns']]
for value_list in data['spreadsheet']:
if value_list[1] == 'ID' or not value_list[1]:
continue
sequence_list = value_list[6].split('-')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment