success using jspreadsheet
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -1,19 +1,30 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import Spreadsheet from "x-data-spreadsheet";
|
||||
|
||||
import jspreadsheet from "jspreadsheet-ce";
|
||||
import "jspreadsheet-ce/dist/jspreadsheet.css";
|
||||
//import 'jsuites/dist/jsuites.min.css'; // required UI styles
|
||||
function load(){
|
||||
const s = new Spreadsheet("#example-table")
|
||||
.loadData({}) // load data
|
||||
.change(data => {
|
||||
// save data to db
|
||||
});
|
||||
|
||||
// data validation
|
||||
s.validate()
|
||||
jspreadsheet(document.getElementById('spreadsheet'), {
|
||||
worksheets: [{
|
||||
data: [
|
||||
["1","Sum of A:","=SUM(A1:A99)"],
|
||||
["2"],
|
||||
["3"],
|
||||
["4"]
|
||||
],
|
||||
columns: [
|
||||
{ type: 'autonumber', title: 'amount' },
|
||||
{ type: 'text', width: '350px', title: 'description', align: 'right' },
|
||||
{ type: 'text', width: '250px', title: 'value' },
|
||||
],
|
||||
// Name of the worksheet
|
||||
worksheetName: 'Albums'
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
</script>
|
||||
|
||||
<div id="example-table"></div>
|
||||
<div id="spreadsheet"></div>
|
||||
Reference in New Issue
Block a user