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

Different breakpoints for different orientation #30

Closed
rashidul0405 opened this issue Feb 12, 2013 · 2 comments
Closed

Different breakpoints for different orientation #30

rashidul0405 opened this issue Feb 12, 2013 · 2 comments
Assignees
Labels

Comments

@rashidul0405
Copy link

Hi,

as we already computed orientation and related stuffs. I think it would be gr8 to support different breakpoints for different orientation.

For example: I've implemented FooTable in one of my project. While I'm on portrait mode, I remove the right side bar and when on landscape I wanna c the right side. As width changes so as Footable breakpoints

@steveush
Copy link
Member

Hi rashidul04,

I get where you coming from but I never implemented this sort of functionality as FooTable works solely off width's and allows you to define multiple width's using the breakpoints option. I originally intended to use orientation etc in the calculations as evidenced by the info object containing these details but as I refactored it down it became apparent that width was the only thing I was concerned about. I left the orientation information in there though so you could use it in a handler bound to one of the custom events and do as you like with it.

That said could you try the following;

Add some new breakpoints defining your portrait widths (the default phone and tablet widths will remain), the below shows an example of this:

$('table').footable({
  breakpoints: {
    phone_p: 320,
    tablet_p: 768
  }
});

Once you have these new breakpoints you can use them where needed to better refine when the column is hidden or shown. In the below example the Status column will now be hidden when in phone and tablet portrait widths.

    <table class="footable">
      <thead>
        <tr>
          <th data-class="expand">
            First Name
          </th>
          <th>
            Last Name
          </th>
          <th data-hide="phone_p,phone,tablet_p,tablet">
            Job Title
          </th>
          <th data-hide="phone_p,phone,tablet_p,tablet">
            DOB
          </th>
          <th data-hide="phone_p,tablet_p">
            Status
          </th>
        </tr>
      </thead>
      <tbody>
          ...
      </tbody>
    </table>

This should allow you to achieve the effect you require.

Thanks
Steve

@ghost ghost assigned steveush Feb 12, 2013
@steveush
Copy link
Member

No response, closing issue.

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

No branches or pull requests

2 participants