static is updated after new corrections

parent 99c68cf9
......@@ -53,10 +53,16 @@
_attachment: "body.json"
}), gadget.getDeclaredGadget("tableeditor") ]);
}).push(function(result_list) {
var i, content, data = JSON.parse(result_list[0]).application_configuration.input;
for (i = 0; i <= Object.keys(data).length; i += 1) {
if (Object.keys(data)[i] === options.action) {
content = data[options.action].configuration.columns;
var i, content, result = JSON.parse(result_list[0]), config = result.application_configuration.input;
// if there are previously stored data in input for this sprSheet
if (result.input[gadget.props.name]) {
content = result.input[gadget.props.name];
} else {
// otherwise use the clean configuration
for (i = 0; i <= Object.keys(config).length; i += 1) {
if (Object.keys(config)[i] === options.action) {
content = config[options.action].configuration.columns;
}
}
}
// application_configuration.input.view_???_spreasheet.configuration
......
......@@ -2,11 +2,22 @@
(function(window, $, rJS, JSON, RSVP) {
"use strict";
rJS(window).declareMethod("render", function(content, options) {
var data = JSON.parse(content), i, def = [];
var data = JSON.parse(content), i, ctrlflag = true, def = [];
// if the content is not an array of arrays then create one
// from the content
for (i = 0; i <= data.length - 1; i += 1) {
def.push(data[i].name);
if (!(data[i].constructor === Array)) {
def.push(data[i].name);
} else {
// otherwise do not modify anything
def = data;
ctrlflag = false;
break;
}
}
if (ctrlflag) {
def = [ def ];
}
def = [ def ];
return this.getElement().push(function(element) {
$(element).find(".table-container").handsontable($.extend({
data: def,
......
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