Import from Excel, JavaScript Programming Example of Import from Excel in SpreadSheet

JavaScript Programming Example of Import from Excel in SpreadSheet

This programming example allows web developers to enable the import of data from Excel to Webix SpreadSheet. Feel free to download this JavaScript coding sample.

JS Code

webix.ready(function(){
  const buttons = {
    width:200, 
    rows:[
       { view:"uploader", value:"Load from Excel file", on:{
        onBeforeFileAdd: function(upload){
          const sheets = $$("ss1");          
          sheets.reset();

          if(!upload.file.options)
            upload.file.options = {};
          webix.extend(upload.file.options, {cellDates: false});

          sheets.parse(upload.file, "excel");
          return false;
        }
      }},
      { view:"button", value:"Save to Excel file", click:function(){
        webix.toExcel("ss1");
      }},
      {}
    ]
  };
  
  webix.ui({
    cols:[ 
      buttons, 
      {
        id:"ss1",
        view:"spreadsheet",
        url: "binary->https://docs.webix.com/samples/65_spreadsheet/common/test.xlsx",
        datatype:"excel",
        toolbar:"full"
      }
    ]
  });
});