Code Monkey home page Code Monkey logo

Comments (2)

steveush avatar steveush commented on July 17, 2024

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

from footable.

steveush avatar steveush commented on July 17, 2024

No response, closing issue.

from footable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.