Comments (4)
you can't init nested by dom attr. my focus has been dynamic grids (since they need to read/write them) using API options eg: https://gridstackjs.com/demo/nested.html, not dom values (which doesn't support all options anyway). see slack channel, someone also was trying...
from gridstack.js.
@adumesny I am on Slack, but can't find anything similar using the search...
Is it possible to initialize GridStack using API and content from HTML? I am looking for something like:
let grid = new GridStack(options)
let items = document.queryElementsByClass('grid-stack-item')
for (let item of items) {
grid.makeWidget(item)
}
let subgrids = document.queryElementsByClass('grid-stack-nested')
for (let subgrid of subgrids) {
grid.makeSubGrid(subgird, suboptions)
}
The use case is to render components using Vue.js and then initialize GridStack on top of it using DOM attributes or JS API.
from gridstack.js.
This almost works, but the positioning and sizing is off: https://jsfiddle.net/kznc3vr7/2/
from gridstack.js.
if you want to donate for this feature (init nested from DOM) it could be added, but frankly not of my radar...
from gridstack.js.
Related Issues (20)
- IOS auto scrolling doesn't work HOT 2
- [BUG] Dragging a widget into the grid doesn't honour expected aspect ratio HOT 2
- Any way to flip the direction of the board? HOT 1
- [Bug] After load(), in some cases the Y position is determined incorrectly & sizes are not restored. HOT 11
- Gridstack in WordPress editor (Gutenberg) mobile preview iframe not working. HOT 4
- Change event not firing on nested grids (resize, move...) HOT 1
- Angular wrapper doesnt have fitToContent option HOT 2
- Demo for lit is not working (https://gridstackjs.com/demo/web-comp.html)
- Responsive grids don't render items with minW correctly on resize HOT 3
- Custom drag element of type button doesn't work HOT 1
- Responsive grid coordinates system is inconsistent HOT 3
- Scale & Different Resolution Question HOT 5
- Unable to set max grid height HOT 1
- How to use Angular library (like PrimeNg) components in gridstack
- GridStack's draggable option doesn't behave as expected when using Vue Rendering Grid Item Content HOT 4
- Updating DOM stack elements within the captured change event are not reflected. HOT 3
- The Change event is not always fired when items have changed after dragging HOT 2
- MakeSubGrid example in the documentation does not work HOT 1
- 'R' can rotate fixed sized or width/height items HOT 3
- Can't cancel an external item from being dragged by pressing 'Esc' key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridstack.js.