• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

x-spreadsheet: x-spreadsheet 是原项目 xspreadsheet 的升级版本、在线表格 javascri ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

x-spreadsheet

开源软件地址:

https://gitee.com/mirrors/x-spreadsheet

开源软件介绍:

x-spreadsheet

npm packageNPM downloadsNPM downloadsBuild passingcodecovGitHubGitHub code size in bytesJoin the chat at https://gitter.im/x-datav/spreadsheet

A web-based JavaScript spreadsheet

Document

CDN

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css"><script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script><script>   x_spreadsheet('#xspreadsheet');</script>

NPM

npm install x-data-spreadsheet
<div id="x-spreadsheet-demo"></div>
import Spreadsheet from "x-data-spreadsheet";// If you need to override the default options, you can set the override// const options = {};// new Spreadsheet('#x-spreadsheet-demo', options);const s = new Spreadsheet("#x-spreadsheet-demo")  .loadData({}) // load data  .change(data => {    // save data to db  });// data validations.validate()
// default options{  mode: 'edit', // edit | read  showToolbar: true,  showGrid: true,  showContextmenu: true,  view: {    height: () => document.documentElement.clientHeight,    width: () => document.documentElement.clientWidth,  },  row: {    len: 100,    height: 25,  },  col: {    len: 26,    width: 100,    indexWidth: 60,    minWidth: 60,  },  style: {    bgcolor: '#ffffff',    align: 'left',    valign: 'middle',    textwrap: false,    strike: false,    underline: false,    color: '#0a0a0a',    font: {      name: 'Helvetica',      size: 10,      bold: false,      italic: false,    },  },}

import | export xlsx

https://github.com/SheetJS/sheetjs/tree/master/demos/xspreadsheet#saving-data

thanks https://github.com/SheetJS/sheetjs

Bind events

const s = new Spreadsheet("#x-spreadsheet-demo")// event of click on cells.on('cell-selected', (cell, ri, ci) => {});s.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});// edited on cells.on('cell-edited', (text, ri, ci) => {});

update cell-text

const s = new Spreadsheet("#x-spreadsheet-demo")// cellText(ri, ci, text, sheetIndex = 0)s.cellText(5, 5, 'xxxx').cellText(6, 5, 'yyy').reRender();

get cell and cell-style

const s = new Spreadsheet("#x-spreadsheet-demo")// cell(ri, ci, sheetIndex = 0)s.cell(ri, ci);// cellStyle(ri, ci, sheetIndex = 0)s.cellStyle(ri, ci);

Internationalization

// npm import Spreadsheet from 'x-data-spreadsheet';import zhCN from 'x-data-spreadsheet/dist/locale/zh-cn';Spreadsheet.locale('zh-cn', zhCN);new Spreadsheet(document.getElementById('xss-demo'));
<!-- Import via CDN --><link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css"><script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script><script src="https://unpkg.com/[email protected]/dist/locale/zh-cn.js"></script><script>  x_spreadsheet.locale('zh-cn');</script>

Features

  • Undo & Redo
  • Paint format
  • Clear format
  • Format
  • Font
  • Font size
  • Font bold
  • Font italic
  • Underline
  • Strike
  • Text color
  • Fill color
  • Borders
  • Merge cells
  • Align
  • Text wrapping
  • Freeze cell
  • Functions
  • Resize row-height, col-width
  • Copy, Cut, Paste
  • Autofill
  • Insert row, column
  • Delete row, column
  • hide row, column
  • multiple sheets
  • print
  • Data validations

Development

git clone https://github.com/myliang/x-spreadsheet.gitcd x-spreadsheetnpm installnpm run dev

Open your browser and visit http://127.0.0.1:8080.

Browser Support

Modern browsers(chrome, firefox, Safari).

LICENSE

MIT


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap