Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

feat(gridster): allow more columns than 6 #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raszi
Copy link

@raszi raszi commented Aug 4, 2014

No description provided.

@stefanahman
Copy link

Is it possible to set this manually in the application?

@raszi
Copy link
Author

raszi commented Sep 17, 2014

This is a bugfix if you want to have more than 6 columns, why should we set that in the application?

@stefanahman
Copy link

I meant the possibility to have more than 3 columns.

@raszi
Copy link
Author

raszi commented Jan 31, 2015

Maybe it is possible but why should we leave a bug in the dashing?

@terraboops
Copy link
Contributor

Maybe a better solution would be to add an optional config object. Store the default config (defaultConfig) in an object, use a deep-copy override overriddenConfig = jquery.extend(true, {}, defaultConfig, Dashing.gridster); and then supply overriddenConfig as the parameter to gridster.

This would allow people to override any of gridster's settings on a per-dashboard basis.

I'd argue that moving into Dashing 2.0, then we should use this approach to customising all aspects of such components. Lodash provides the same extend functionality, if jQuery is undesirable.

So instead of setting Dashing.widget_margins in your dashboard to customise, you'd set Dashing.gridster.widget_margins (or Dashing.gridster = {widget_margins: ...})

@raszi
Copy link
Author

raszi commented Jan 31, 2015

I did not modify the widget_margins.

I just added the max_size_x property because that was missing from the setup therefore somebody could set the numColumns config in their app but the gridster still used the previous (default) column count.

What is the reason to make numColumns configurable if you cannot set to any value you want?

@terraboops
Copy link
Contributor

Let me rephrase my last sentence (which was a generalisation, not specific to you):

So instead of setting Dashing.numColumns in your dashboard to customise, you'd set Dashing.gridster.max_size_x (or Dashing.gridster = {max_size_x: ...})

The reason why I make this suggestion is that you may want this flag, but another developer may want to set a different flag. If we add each one by one, pretty soon we will have replicated Gridster's API and we'll have a mess of flags.

@terraboops
Copy link
Contributor

I've already said my peace on this PR -- I don't support adding one more flag.

@pushmatrix
Copy link
Member

I'm not able to reproduce the problem. I can set Dashing.numColumns = 9 and I get more than six columns, and my widgets can also span the whole length. Was there a new version of gridster that put a hard limit at 6?

@DeanCording
Copy link

The problem is that widgets can only be 0-5 columns wide, irrespective of the dashboard width. If you specify more than 5 columns wide for a widget it fills the entire dashboard width. I encountered this issue with a dashboard I am developing. To maximise the use of screen space, I have set the column width to 50px, with most widgets being 4 or 5 columns wide. The problem occurs when I have a larger widget that takes up 10 columns, it fills the entire dashboard width.

I can confirm that the proposed fix solves this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants