BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
Setup: Typescript, ReactJs via create-react-app and functional components.
I see how you can put your own components into the
What I'm trying to do at the moment is save the layout and restore it with the react components inside of the panels. It seems that every time I restore them, it clears it out and I just get 3 blank panels.
Any help here would be greatly appreciated!
Thanks!
Here is the code as it currently stands (still WIP so excuse some of the code, please):
So I did some experimenting and I tried adding a JSX.Element to the comment type in the interface file for PanelModel (in the node_modules folder) and it didn't seem to want to work. THEN, I set it as an any field and it all worked just fine. I was able to restore the data with the components intact with only a slight amount of tweaking.
It shows that components could be supplied with minimal effort but as it stands, it's not a deploy-able solution to my task.
Hoping someone can give me a less hacky way of solving this.
Hi Erick Stover,
Greetings from Syncfusion support.
We have validated your reported query in the dashboard Layout component. We have already documented state maintenance in the Dashboard Layout
the component in the below link.
https://ej2.syncfusion.com/react/documentation/dashboard-layout/state-maintenance/
To overcome the reported issue, we suggest you to set the panel contents manually. Refer to the below code.
[index.js],
onSave(args) { var dashboard = document.getElementById('defaultLayout').ej2_instances[0]; this.restoreModel = dashboard.serialize(); this.restoreModel[0].content = '<div class="content">0</div>'; this.restoreModel[1].content = '<div class="content">1</div>'; this.restoreModel[2].content = '<div class="content">2</div>'; this.restoreModel[3].content = '<div class="content">3</div>'; this.restoreModel[4].content = '<div class="content">4</div>'; this.restoreModel[5].content = '<div class="content">5</div>'; this.restoreModel[6].content = '<div class="content">6</div>'; }
|
Sample: https://stackblitz.com/edit/react-rp2u8z?file=index.js
Please check the attached sample for reference and get back to us if you need any further assistance.
Regards,
Sivakumar S