Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Responsive Columns #235

Merged
merged 7 commits into from
Oct 25, 2016
Merged

[FEATURE] Responsive Columns #235

merged 7 commits into from
Oct 25, 2016

Conversation

offirgolan
Copy link
Collaborator

Resolves #219.

This PR introduces a responsive solution. Using ember-responsive, I have introduced two methods to handle responsive behaviors that will hide the appropriate columns. This PR also introduces a new table property responsiveHiddenColumns to be able to easily distinguish between hidden columns and columns hidden from this responsive behavior.

Via column definition

Specify an array of media breakpoints that determine when this column will be shown. If we have the following breakpoints defined in app/breakpoints.js:

  • mobile
  • tablet
  • desktop

And we want to show this column only for tablet and desktop media, the following array should be specified:

{
  breakpoints: ['tablet', 'desktop']
}

If this property is null, undefined, or [], then this column will always be shown, regardless of the current media type.

Via light-table component

Pass a hash to determine the number of columns to show per given breakpoint. If this is specified, it will override any column specific breakpoints. If we have the following breakpoints defined in app/breakpoints.js:

  • mobile
  • tablet
  • desktop

The following hash can be passed in:

{{#light-table table breakpoints=(hash 
  mobile=2
  tablet=4
) as |t|}}

{{/light-table}}

If there is no rule specified for a given breakpoint (i.e. desktop), all columns will be shown.

Copy link
Collaborator

@taras taras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@offirgolan this looks good. Ideally, we wouldn't couple this implementation to ember-responsive but we can let demand dictate any future work. Great to see that there is a demo and tests! 👍

@offirgolan
Copy link
Collaborator Author

@taras I agree but at the same time I believe ember-responsive is pretty widely used and a trust worthy addon to depend on. I just dont think we should be spending time to reinvent the wheel here. If there will be much of a demand to decouple, we can cross that bridge then 😸

@taras
Copy link
Collaborator

taras commented Oct 24, 2016

I agree too!

* master:
  [FEATURE] ScrollTo and ScrollToRow (#228)
@offirgolan offirgolan merged commit a26205d into master Oct 25, 2016
@offirgolan offirgolan deleted the responsive branch October 25, 2016 02:30
@jamesdixon
Copy link

You guys are killin' it. Nice work!

offirgolan added a commit that referenced this pull request Nov 7, 2016
* master: (42 commits)
  Resizable column fixes (#252)
  fix: repeated scrollToRow (#254)
  chore(package): update ember-cli-code-coverage to version 0.3.7 (#253)
  Demo Cleanup (#251)
  chore(package): update ember-lodash to version 0.0.11 (#245)
  chore(package): update ember-cli-code-coverage to version 0.3.6 (#249)
  Document `Row#content` (#250)
  Update resizable snippet
  Released v1.5.2
  [FEATURE] minResizeWidth + Event bubbling fix (#244)
  Update readme
  Update readme
  Released v1.5.1
  Add safe checks scroll logic (#241)
  [DOCFIX] Make breakpoints of demo app the same as ember-responsive's default (#240)
  Released v1.5.0
  Demo + Scrolling Cleanup (#238)
  [FEATURE] Responsive Columns (#235)
  [FEATURE] ScrollTo and ScrollToRow (#228)
  chore(package): update broccoli-asset-rev to version 2.5.0 (#227)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants