Hi,
I am planning to use React Spreadsheet for one of my projects. Unfortunately, I am unable to bind remote data to spreadsheet. All examples I could find are using static files to set the spreadsheet structure and on my own tests I failed to re-render spreadsheet component when remote data is bound. Could you please provide an example in that matter?
Here is my code:
const defaultStructure = {
sheets: [
{
name: t('Summary'),
mergedCells: ['B1:C1'],
rows: [
{
height: 25,
cells: [
{
value: t('Please enter customer name'),
textAlign: 'center',
index: 0,
},
{
background: 'rgb(167,214,255)',
textAlign: 'center',
index: 1,
},
],
},
{
height: 50,
cells: [
{
value: t('Please enter minimum gross salary of your region'),
textAlign: 'center',
index: 0,
},
{
value: '',
background: 'rgb(167,214,255)',
textAlign: 'center',
index: 1,
},
],
},
],
columns: [
{
width: 400,
},
{
width: 200,
},
{
width: 400,
},
],
},
{
name: t('Parametric Data Entry'),
rows: [],
columns: [
{
width: 100,
},
{
width: 100,
},
],
},
],
}
const [structure, setStructure] = useState(defaultStructure)
useEffect(() => {
if (!store?.parameters.isLoaded) return
const p = store?.parameters.parameters
const s = defaultStructure.sheets[0]
defaultStructure.sheets[0].rows[1].cells[1].value = p?.grossWage
setStructure({ ...defaultStructure })
}, [store?.parameters.isLoaded])
return (
<>
<div className="p-3">
<div className="card-body">
<Spreadsheet
style={{
width: '100%',
height: 680,
}}
defaultProps={structure}
/>
</div>
</div>
</>
)
})
Regards,
Sorry, I find the solution on Data Import and Export - KendoReact (telerik.com)
Best regards,
Hi, Cagdas,
I am glad that you were able to find the solution.
However, if you require further assistance or have any further questions on this matter, please let me know.
Regards,Wissam
Progress Telerik