Code Monkey home page Code Monkey logo

Comments (4)

IbrahimAlhaj9 avatar IbrahimAlhaj9 commented on June 9, 2024

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

from x-spreadsheet.

yesusagayarajs avatar yesusagayarajs commented on June 9, 2024

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

from x-spreadsheet.

IbrahimAlhaj9 avatar IbrahimAlhaj9 commented on June 9, 2024

Thank you , it is working now

from x-spreadsheet.

yesusagayarajs avatar yesusagayarajs commented on June 9, 2024

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

from x-spreadsheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.