question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When the number of columns is dynamically changed, the columns are not dynamically rearranged. Is there an option to order the gridster reorganize?

The code:

  // Define o tamanho da coluna na grid de widgets
    var colWidth = 400;

    // Define a quantidade de colunas na grid pelo tamanho da janela do browser
    var window = angular.element($window);
    var columns = Math.floor(window.width() / colWidth);

    // Calcula a quantidade de colunas na grid dinamicamente
    window.bind('resize', function () {
        columns = Math.floor(window.width() / colWidth);
        $scope.gridOptions.columns = columns;
        $scope.$apply();
    });

    // Configurações da grid de widgets
    $scope.gridOptions = {
        columns: columns,
        colWidth: colWidth,
        rowHeight: 360,
        margins: [50,20],
        resizable: {
            enabled: false
        },
        draggable: {
            enabled: true,
            handle: 'header'
        }
    };

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:23 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
arkabidecommented, Oct 10, 2016

Maybe it’s to late for you guys but it may be helpful for others. I came across the same need so I went ahead and implemented it in this branch of my fork: https://github.com/arkabide/angular-gridster/tree/dynamic-colums

Feature can be turned on/off with a new gridster property ‘dynamicColumns’ (boolean). I also needed a minimum width to trigger a column rearrangement so I added another property called ‘minWidthToAddANewColumn’ (not the best name, feel free to change it).

Live demo: https://cdn.rawgit.com/arkabide/angular-gridster/dynamic-colums/index.html

Click on “Enable Dynamic Columns” and resize the window to see the columns dynamically rearrange.

0reactions
groobybugscommented, Nov 13, 2017

@arkabide man, never it’s too late, THANKS! 😃 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic Columns Functions - MariaDB Knowledge Base
Dynamic columns is a feature that allows one to store different sets of columns for each row in a table. It works by...
Read more >
Dynamic Columns | Apache Phoenix
To upsert a row with dynamic columns: UPSERT INTO EventLog (eventId, eventTime, eventType, lastGCTime TIME, usedMemory BIGINT, maxMemory BIGINT) VALUES(1, ...
Read more >
Dynamic Columns - Tech Tips Girl
One way to have dynamic columns is to use Parameters. In my Tableau Public dashboard here, I created Parameters for you to adjust...
Read more >
Power BI - Dynamic Columns in a Table - Perficient Blogs
Power BI – Dynamic Columns in a Table ... the dynamic slicers works on factual values because we use Measures in there.
Read more >
Writing dynamic columns from a source file to a database - 8.0
You will read dynamic columns from a source file, map them and then write them to a table in a MySQL database. By...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found