Research if and how we can export react grid layout matrix #200

Closed
opened 2026-04-09 09:21:36 +00:00 by a24vinla · 4 comments
Collaborator

If we can export/save the active positions and sizes of grid elements it would be help us when saving each users personal screen.
This has examples of the matrices

Parent Issue: #173

If we can export/save the active positions and sizes of grid elements it would be help us when saving each users personal screen. [This](https://react-grid-layout.github.io/react-grid-layout/examples/00-showcase.html) has examples of the matrices Parent Issue: #173
Collaborator

This link has a function that listens to layout changes and then uses the "stringifyLayout()" to print the positions of all cards. May need to modify it a bit to fit the code we have, but should be a good start.

It needs a class to work, the class should be the grid system. In the bottom of the grid system it uses the following line that leads to the file i linked:

if (process.env.STATIC_EXAMPLES === true) {
  import("../test-hook.jsx").then(fn => fn.default(BasicLayout));
}
This [link](https://github.com/react-grid-layout/react-grid-layout/blob/master/test/test-hook.jsx) has a function that listens to layout changes and then uses the "stringifyLayout()" to print the positions of all cards. May need to modify it a bit to fit the code we have, but should be a good start. It needs a class to work, the class should be the grid system. In the bottom of the grid system it uses the following line that leads to the file i linked: ``` if (process.env.STATIC_EXAMPLES === true) { import("../test-hook.jsx").then(fn => fn.default(BasicLayout)); } ```
Author
Collaborator

This link also shows how you can load a preexisting layout from local storage. We should be able to emulate this.

This [link](https://github.com/react-grid-layout/react-grid-layout/blob/master/test/examples/07-localstorage.jsx) also shows how you can load a preexisting layout from local storage. We should be able to emulate this.
Author
Collaborator

This has the source code for the layout class which has a CloneLayout function and a validate function, both of which could be valuable.

[This](https://github.com/react-grid-layout/react-grid-layout/blob/master/src/core/layout.ts) has the source code for the layout class which has a CloneLayout function and a validate function, both of which could be valuable.
Author
Collaborator

The difficult part will not be to get positions of objects and general grid settings, but rather storing positions and which view is used. Will close this issue as it is confirmed to be possible.

The difficult part will not be to get positions of objects and general grid settings, but rather storing positions and which view is used. Will close this issue as it is confirmed to be possible.
Sign in to join this conversation.
No milestone
No project
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#200
No description provided.