Open yesusagayarajs opened 1 year ago
@yesusagayarajs I have the same issue, did you find the solution? thank you.
I made it empty for index.less file . now it is working .
Thank you , it is working now
Hi @IbrahimAlhaj9 Please add your header section text display name and value as tablefieldname. "rows": { "0": { "cells": {
"0": {
"text": "Asunto",
"value": "subject",
"style": 10,
"editable": false,
"required":true,
"type":"text"
},
"1": {
"text": "type",
"value": "typ",
"style": 10,
"editable": false,
"required":true,
"type":"picklist"
},
}
}
}
this.spreadsheetData = new Spreadsheet("#testSheet", {
mode: "edit",
//showToolbar: true,
showGrid: true,
//showContextmenu: true,
view: {
height: function () {
return 400;
},
width: function () {
return 1200;
}
},
row: { len: 10, height: 25 },
col: {
len: 4,
width: 100,
indexWidth: 60,
minWidth: 60
}
})
.loadData(this.testSheetData)
.change((data) => {
this.onchangeData(data)// onchange function
});
//console.log(mySpreadSheet.validate());
this.spreadsheetData.on('cell-edited', (cell, ri, ci) => {
console.log('cell:', cell, ', ri:', ri, ', ci:', ci);
})
//You will map the based the row values
let header = rows[0]['cells'];
for(let index in header) {
let fieldName = header[index].value;
let val='';
if(resRe[fieldName]!=undefined) {
if (typeof resRe[fieldName] === 'string' || resRe[fieldName] instanceof String) {
val=resRe[fieldName];
fieldValue[index]={'text':val,'id':rec};
}else {
if(fieldName=='ref_product') {
if(resRe[fieldName].length>0) {
val = resRe[fieldName][0].label;
}
}else {
val=resRe[fieldName].label;
}
fieldValue[index]={'text':val,'id':rec};
}
}else {
fieldValue[index]={'text':val,'id':rec};
}
}
./node_modules/x-data-spreadsheet/src/index.less:1:5 - Error: Module parse failed: Unexpected token (1:5) File was processed with these loaders:
any solution ?