gridstack.js | Build interactive dashboards in minutes | Dashboard library

 by   gridstack TypeScript Version: v8.3.0 License: MIT

kandi X-RAY | gridstack.js Summary

kandi X-RAY | gridstack.js Summary

gridstack.js is a TypeScript library typically used in Analytics, Dashboard, Angular, React, Bootstrap applications. gridstack.js has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Mobile-friendly modern Typescript library for dashboard layout and creation. Making a drag-and-drop, multi-column responsive dashboard has never been easier. Has multiple bindings and works great with React, Vue, Angular, Knockout.js, Ember and others (see frameworks section). Inspired by no-longer maintained gridster, built with love. Check and these demos.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              gridstack.js has a medium active ecosystem.
              It has 5056 star(s) with 1194 fork(s). There are 165 watchers for this library.
              There were 9 major release(s) in the last 12 months.
              There are 31 open issues and 1250 have been closed. On average issues are closed in 13 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of gridstack.js is v8.3.0

            kandi-Quality Quality

              gridstack.js has no bugs reported.

            kandi-Security Security

              gridstack.js has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              gridstack.js is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              gridstack.js releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gridstack.js
            Get all kandi verified functions for this library.

            gridstack.js Key Features

            No Key Features are available at this moment for gridstack.js.

            gridstack.js Examples and Code Snippets

            No Code Snippets are available at this moment for gridstack.js.

            Community Discussions

            QUESTION

            Unable to load layout content from browser storage
            Asked 2020-Oct-06 at 19:14

            I am using a library called gridstack.js. I have a grid which looks like below ↓

            This is the code I used:

            ...

            ANSWER

            Answered 2020-Oct-06 at 19:14

            as mentioned in the 'bug' reported https://github.com/gridstack/gridstack.js/issues/1405, he's mixing old API call of $(".grid-stack") which is jquery code based for v0.6 and older and the latest version 2.x which uses GridStack.init() to init and return a grid pointer.

            GridStack does not use jquery API since 1.x

            Source https://stackoverflow.com/questions/64219336

            QUESTION

            Prevent rerendering of custom Control
            Asked 2020-Aug-06 at 13:29

            For our openUI5 application I have developed two custom controls. One utilizing the gridstack.js library and another using the HighCharts library. The former has the latter as aggregation 'charts' (1...n). When I update the property in the model(deleting, adding a chart), the wrapper control re renders the charts (default behavior).

            Is there a way to prevent re-rendering of the aggregation, because it causes both libraries to reload some stuff and this behavior we must avoid.

            I thought about calling validate() on the charts aggregation as well as overwriting the setAggregation in the wrapper control.

            Any help would be appreciated.

            ...

            ANSWER

            Answered 2020-Aug-06 at 13:29

            The solution was to use sap.ui.core.HTML; This control was meant for this scenario, its property preferDOM does exactly that. So instead of rendering the HTML of the libraries im using, i set it as content of the sap.ui.core.HTML control.

            Source https://stackoverflow.com/questions/63249581

            QUESTION

            gridstack.js set grid-stack-item height auto based on inner content
            Asked 2020-Apr-14 at 11:44

            Is there any option to use gridstack.js with each grid-stack-item height based on inner content like image.

            In my scenario each images having different height so it's not showing correctly on card.

            It gives scrollbar inside grid-stack-item to view image, that is wrong.

            Any option or workaround or other JS plugin/library that will restrict fixed height based on any factor.

            Current behavior

            Expected behavior

            Height will be 100% based on width so image aspect ratio preserves.

            ...

            ANSWER

            Answered 2018-Aug-27 at 11:46

            I managed to do by setting up cellHeight : 10 then get image in resizestop event and update updateWidget.

            Below is sample code for that resizestop event.

            Source https://stackoverflow.com/questions/51878468

            QUESTION

            Gridstack: Dragging widget from one grid into another, nested one
            Asked 2019-May-01 at 03:01

            I am trying to create this behavior and not sure whether Gridstack supports it or not. I have 3 Gridstack grids: Grid1, Grid2, and Grid3. Grid1 is a standalone grid and Grid3 is nested inside Grid2. I need to be able to drag widgets from Grid1 both into Grid2 (outer grid) and into Grid3 (nested grid). Following samples I was able to drag widgets between 2 top level grids and create a nested grid, but not combining these 2 together. If this is supported - any pointers are appreciated.

            NB: Expand the snippet to full screen

            ...

            ANSWER

            Answered 2019-Apr-30 at 12:36

            This is code from an old drag/drop fiddle I composed (an age ago!), with areas that are both draggable and droppable. The items that can be pulled across to either of the droppable areas can be dragged again from one area to another and dragged up and down. While the items are not sized the same as are in your example, it goes to show that the same user experience can be achieved by using simply jquery/jquery-ui without sticking to gridstack. You may save yourself some laborious hours by working outside the grid! ;)

            Hope this helps

            fiddle

            Source https://stackoverflow.com/questions/55818594

            QUESTION

            How to get the new y-value within gridstack.js
            Asked 2019-Apr-04 at 04:44

            I'm using Gridstack for draggable div's. How do I get the new value of data-gs-y (so to which y-axis the div was dropped). Actually I tried this:

            ...

            ANSWER

            Answered 2019-Apr-04 at 04:44

            I think you can use "mutation observer" to listen changes to the attribute 'data-gs-y' on each div element. I wrote following code and verified on this demo http://gridstackjs.com/demo/knockout.html

            Source https://stackoverflow.com/questions/55507030

            QUESTION

            can't read property addWidget of undefined with JSON and gridstack
            Asked 2019-Jan-22 at 03:01

            Running into a problem with my attempt to build a gridstack dash

            I get "Uncaught TypeError: Cannot read property 'addWidget' of undefined" when trying to load the page.. (the code is based on the basic gridstack serialized demo https://github.com/gridstack/gridstack.js/blob/develop/demo/serialization.html)

            my changed script section is

            ...

            ANSWER

            Answered 2019-Jan-22 at 03:01

            It seems like the context of this in the loadGrid method may be incorrect, try changing it to this:

            Source https://stackoverflow.com/questions/54287633

            QUESTION

            gridstack.js: Added widgets now dragable
            Asked 2018-Nov-14 at 10:33

            I am creating a empty grid with gridstack.js and them adding new elements thougth its API. The new items are visualized correctly. They and are re-sizable, but I can not drag them around the grid. I tried to use enable() and also enableMove(true, true) but it seem have no effect.

            This example only contains one elements, but i pretend to add more when it works.

            This is the page:

            ...

            ANSWER

            Answered 2018-Nov-14 at 10:33

            The div pased to the addWidget function should have this structure to work correctly:

            Source https://stackoverflow.com/questions/53277908

            QUESTION

            How do I add gridstack.js to Ractive.js?
            Asked 2018-Oct-21 at 18:28

            I am creating example application with Ractive.js and gridstack.js, but can't figure out how to add gridstack as a decorator. I think this is the proper way to add jQuery elements to ractive.js, please advise if it's not.

            After I created a decorator and assigned it to the Dashboard component it actually doesn't work and events from gridstackDecorator aren't cached in the Dashboard component.

            I created this Fiddle with the code that doesn't work and the source is below:

            Ractive.js component tree will look like:

            ...

            ANSWER

            Answered 2018-Oct-21 at 18:28

            You have to instruct Ractive about on which element(s) you want your decorator to be called on by adding "as-${decoratorName}" to the element, like, in your case

            Source https://stackoverflow.com/questions/41672875

            QUESTION

            Is there a way to use a working HTML page as an Angular 5/6 component?
            Asked 2018-Jun-21 at 07:37

            We are undergoing an project in Angular 5/6 where we get prebuilt HTML pages, that use jQuery, gridstack.js and CSS for UI, that we'll implement as components. Assuming it's not possible to rewrite all the jQuery and JS code in Angular, is there any way to run the jQuery code provided in the tag directly in Angular?

            I have already tried importing jQuery as:

            ...

            ANSWER

            Answered 2018-Jun-21 at 07:33

            It is possible and could be a good intermediate step on a migration path.

            I am working on a project right now where we have a JQuery-based app. It has a lot of CSS and HTML code inside the JS code to handle state changes and change content and styling accordingly. It is relatively messy.

            We took a number of steps of migrating to Angular, with the first being what you are describing. It definitely already helped gain an overview of the code base and structure the code in a much more maintainable way than it was before.

            1. I took the HTML and broke it down into Angular components. For this step, we just left the JQuery code in the main AppComponent TS file. You can simply use JQuery in Angular TS files with a declare const $: any;.
            2. I broke down the the JQuery code and migrated everything that was template related (e.g. changing parts of the DOM tree based on events/state) into the Angular HTML files.
            3. I took the one large CSS file and moved the CSS rules to the individual components.
            4. I went through the entire remaining JQuery code and piece by piece migrated it to proper Angular code.

            It proved to be a viable strategy. We were first considering re-writing the entire project, but like this we always had a running version, could continuously run UI tests against it and piece by piece migrate.

            All of that is to say: I would not see a JQuery/Angular mix as a final solution, but it can be a good migration strategy.

            Source https://stackoverflow.com/questions/50962526

            QUESTION

            How to set widget data from local storage using gridstack.js
            Asked 2018-Jun-18 at 22:46
            Scenario

            I have a dashboard with some widgets grouped into tabs that the user can click through. The widgets have default starting positions including height and width, but if the user moves or resizes them (using gridstack.js) I save the new widget data to local storage.

            If the user clicks between tabs the new widget positions are maintained.

            Problem

            When the user refreshes the page, the default widget positions are loaded instead of the data in local storage. I tried to set the new positions using getWidgetData() but no luck.

            I have checked local storage for my grid-layout data and the new positions are present.

            Code example

            Here is Codepen since I think SO requires allow-same-origin, thus breaking the snippet.

            ...

            ANSWER

            Answered 2018-Jun-18 at 22:46

            You need to look into few things.

            The default examples that are available are for a single instance whereas you have multiple.

            You are saving and loading the gridstack in one go which means you have no track of the element grid-stack-item and also you have no track which point belongs to which instance the first tab or the second,

            So even if you get it to work it will try to position all the 6 different widgets inside the very first tab rather than loading it in their respective tabs.

            So you need to make changes to the following

            • $('.grid-stack').on('change', function (event, items) {

            • getWidgetData()

            • assign id or custom-data-id attribute in you grid-stack-items so that they have a unique identifier

            • wrap the tabs inside a conatiner with id tabs-cotnainer.

            on the event change for the gridstack you should create the json object consisting the points in the sections dedicated to the tabs it will store like below.

            Source https://stackoverflow.com/questions/50913511

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install gridstack.js

            You can download it from GitHub.

            Support

            Documentation can be found here.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/gridstack/gridstack.js.git

          • CLI

            gh repo clone gridstack/gridstack.js

          • sshUrl

            git@github.com:gridstack/gridstack.js.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link