Giter Site home page Giter Site logo

Comments (3)

adammessinger avatar adammessinger commented on August 21, 2024

Thanks for the feature request, @appel. I've added it to my to-do list.

from flexitable.

appel avatar appel commented on August 21, 2024

Thanks @adammessinger, looking forward to it!

from flexitable.

adammessinger avatar adammessinger commented on August 21, 2024

I've made some notes about implementation of this feature request that I'm also putting here for feedback and future reference...

  • Keep it compact and simple: array of columns such that keys match column_maps_list, with values of 0 for hidden or 1 for shown.
  • Load saved visibility state array after init (or create it w/ all visible if it doesn't exist).
  • Update visibility array value for a column when user checks/unchecks a column box, but save to localStorage after showing/hiding the column to avoid a slowdown in visual response to user input.
  • Some localStorage issues to keep in mind.
  • Need to give some thought to storage keys. Simply using the table ID could cause data over-writes and unexpected behavior if the plugin user has multiple tables with the same ID. Something like this would work as long as there are no tables with matching IDs at the same URL: 'flexitable_[' + window.location.href + ']_' + view_model.id
  • Be mindful of storage quotas. As a product or site using Flexitable evolves, tables and whole pages may disappear or table IDs may change. Orphaned keys may bloat storage, and there's a slim chance of exceeding quota. Handle the resulting error (and the lack thereof in IE) gracefully, perhaps by (silently?) clearing all Flexitable storage for that domain and then retrying the save.
    • Some quick calculations assuming tables with 24 columns and pages with longish URLs indicate that Flexitable could store up to about 25,000 tables worth of column visibility info per origin for browsers with a 10 MB quota -- half that for some browsers with a 5 MB quota.
    • According to MDN, Safari gives localStorage a quota of 0 in private browsing mode, rendering it unusable. Look into exactly how this manifests in terms of quota errors. Fortunately, other browsers are said to simply treat localStorage like sessionStorage in private mode.

from flexitable.

Related Issues (6)

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.