GithubHelp home page GithubHelp logo

Comments (4)

adumesny avatar adumesny commented on June 10, 2024

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.

vmihailenco avatar vmihailenco commented on June 10, 2024

@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.

vmihailenco avatar vmihailenco commented on June 10, 2024

This almost works, but the positioning and sizing is off: https://jsfiddle.net/kznc3vr7/2/

from gridstack.js.

adumesny avatar adumesny commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.