Examples#
Here are gridsheet examples in demo.
Example1 - Simple example with formula#
- Project:
- Source:
Support formula
Ref
Absolute Ref
functions
custom function
Cell config:
options.cells[column].width
: Column width.options.cells[column].style
: Cell style in the column.
Example2 - Custom renderers with dark mode#
- Project:
- Source:
Dark mode:
options.mode = 'dark'
: Set mode dark
API response format:
oa2aa(response.data)
: convertsobject in array
toarray in array
Custom renderer:
ThousandSeparatorRenderer: renders a number with comma. (built-in)
ImageRenderer: renders an image related to the string as a link.
LinkRenderer: renders a string as a link.
Cell label
options.labelers
: Functions to make label by object.cell.labeler
: Name to extract the label function above.
Freeze number of columns.
options.minNumCols = 5
options.maxNumCols = 5
Example3 - Event handling#
- Project:
- Source:
Custom parser:
ListParser: parses a newline delimited string as a (string) list.
Feedback functions:
onSave:
setTsv
is set to render TSV.onChange:
console.log
is set to show the changes.
Example4 - Date reloading#
- Project:
- Source:
Would be fixed.
The above sheet is test data.
The sheet below shows two-factor coverage combinations made from the testdata.
Pairwise tool: CoverTable.
Example5 - Limit width, Resize, Multiple sheets#
- Project:
- Source:
style
andclassName
props will be passed.{ maxWidth: "100%"}
prevents the sheet exceeding the parent width.
options.sheetResize
means css resize of the sheet.
Example6 - Change the data from outside#
- Project:
- Source:
use tableRef
tableRef has
dispatch
andtable
update table and dispatch it.