Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./node_modules/x-data-spreadsheet/src/index.less:1:5 - Error: Module parse failed: Unexpected token (1:5) angular 15 #661

Open
yesusagayarajs opened this issue Jul 28, 2023 · 4 comments

Comments

@yesusagayarajs
Copy link

./node_modules/x-data-spreadsheet/src/index.less:1:5 - Error: Module parse failed: Unexpected token (1:5)
File was processed with these loaders:

  • ./node_modules/less-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.

body {
| margin: 0;
| }

any solution ?

@IbrahimAlhaj9
Copy link

@yesusagayarajs I have the same issue, did you find the solution?
thank you.

@yesusagayarajs
Copy link
Author

I made it empty for index.less file . now it is working .

@IbrahimAlhaj9
Copy link

IbrahimAlhaj9 commented Aug 4, 2023

Thank you , it is working now

@yesusagayarajs
Copy link
Author

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};
              }
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants