Commit a5615f8c by Simon

Fix beug

parent b157647d
......@@ -2,8 +2,6 @@
border-collapse: collapse;
width: 100%;
font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
margin-top: 150px;
}
.table-responsive {
......
......@@ -179,12 +179,14 @@
this.getJsonData = () => {
let dataJson = this.item.data('json');
if(this.isJsonString(dataJson)){
if(typeof dataJson === 'object') {
this.json = dataJson;
} else if(this.isJsonString(dataJson)){
this.json = JSON.parse(dataJson);
} else {
let data = this.fileExistsAndGetData(dataJson);
if(data){
let json = JSON.parse(data);
let json = JSON.parse(data);
if (!$.isEmptyObject(json)) {
this.json = json;
......@@ -227,7 +229,7 @@
* Generate JSON
*/
this.createJSON = () => {
let $input = $(this.config.output);
let $input = $(this.config.inputSelector);
if ($input.length > 0) {
$input.val(JSON.stringify(this.outputJson));
......@@ -631,7 +633,9 @@
this.getJsonData = () => {
let dataJson = $(this.config.inputSelector).val();
if(this.isJsonString(dataJson)){
if(typeof dataJson === 'object') {
this.json = dataJson;
} else if(this.isJsonString(dataJson)){
this.json = JSON.parse(dataJson);
} else {
let data = this.fileExistsAndGetData(dataJson);
......@@ -643,10 +647,10 @@
}
}
}
this.populateOutputJson();
};
this.populateOutputJson = () => {
for (let index in this.json) {
if (this.json[index].length === 0 ) {
......
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