dream-num / luckysheet-react Goto Github PK
View Code? Open in Web Editor NEWluckysheet react demo
luckysheet react demo
Luckysheet.componentDidMount
is called twice because index.js
uses React.StrictMode
. When in multi-user collaboration (enabled allowUpdate and loadUrl etc), this caused the session to hang at "waiting for update". Although I'm not sure why that happened, remove the strict mode does help...
参考Luckysheet-vue
I try to disabled headers row in lucky sheet but I don't get any soln. of it. I am using ReactJs.
Plese Help.
`import { useEffect, useRef } from 'react';
export const CaptableGrid = ({ isInvestor = false }) => {
const LUCKYDATA = [
[
'First Name',
'Last Name',
'Country Code',
'Mobile',
'Email',
],
['', '', '', '', '', '', '', ''],
];
const tableArray: any = [];
(isInvestor ? LUCKYDATA?.forEach(
(rows: any, rowIndex: any) => {
rows.forEach((row: any, colIndex: any) => {
const cellObj = {
r: rowIndex,
c: colIndex,
v: {
ct: { fa: 'General', t: 'g' },
m: row,
v: row,
},
};
tableArray.push(cellObj);
});
}
);
const luckysheet = useRef(null);
useEffect(() => {
luckysheet.current = (window as any)?.luckysheet;
(luckysheet as any).current.create({
container: 'luckysheet',
showtoolbar: false,
showsheetbar: false,
showinfobar: false,
showstatisticBar: false,
sheetFormulaBar: false,
defaultColWidth: 144,
defaultRowHeight: 32,
row: 10,
data: [
{
celldata: tableArray,
},
],
hook: {
cellUpdated: () => {
return true;
},
},
});
setTimeout(() => {
(luckysheet?.current as any)?.setHorizontalFrozen(false);
}, 500);
// eslint-disable-next-line
}, []);
return (
<div
id="luckysheet"
style={{
margin: '0px',
padding: '0px',
position: 'absolute',
width: '100%',
height: '100%',
left: '0px',
top: '0px',
}}
></div>
);
};
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.