Commit 3db5ca2b authored by Jérome Perrin's avatar Jérome Perrin

update static version

parent 24d7df81
......@@ -2,10 +2,25 @@
(function(window, $, rJS, JSON, RSVP) {
"use strict";
rJS(window).declareMethod("render", function(content, options) {
var data = JSON.parse(content);
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) {
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 ];
}
return this.getElement().push(function(element) {
$(element).find(".table-container").handsontable($.extend({
data: data,
data: def,
stretchH: "all"
}, options || {}));
});
......
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