success using jspreadsheet

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-03-18 23:42:01 +01:00
parent d936c08d35
commit 62981b22b5
3 changed files with 41 additions and 706 deletions

View File

@@ -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>