Giter VIP home page Giter VIP logo

Comments (2)

joequery avatar joequery commented on July 30, 2024

This is a very good point I had not considered. I believe toggling should be the default behavior, but you're absolutely right, there should be a way of overriding that behavior. I'll need to decide whether this setting should take place in the HTML (which I'm afraid is already becoming a bit bloated with all the various data-sort attributes we're using) or the plugin itself.

The HTML route, we could have something like

<table id="simpleTable">
    <thead>
        <tr>
        <th data-sort="int">int</th>
        <th data-sort="float" data-sort-no-cache>float</th>
        <th data-sort="string">string</th>
        </tr>
    </thead>
    <tbody>
  ...

but then we're just saying "HTML semantics be damned", even more than we already are 😛

I actually think the paradigm of specifying ALL settings for a plugin in the initial plugin call is really ugly. The benefit is less chances of name collision, but then you end up with stuff like

$("#selector").myplugin({
        "settingsAttr1": {
            "opt1": 1,
            "opt2": 2
        },
        "settingsAttr2": {
            "opt1":1,
            "opt2":2,
        }
});

I know this is the standard way of doing things, but I really hate it.

So perhaps we could have something along the lines of

var mytable = $("#selector").stupidtable(sortFns)

// Don't cache table columns 0, 1, or 5
mytable.no_stupid_sort_cache(0,1,5);

The implementation of this no_stupid_sort_cache may use data attributes in the JS - the difference is making the plugin handle this makes the HTML less of a config file (which is definitely something I want to avoid)

from stupid-table-plugin.

joequery avatar joequery commented on July 30, 2024

Columns are no longer just being reversed.

See https://github.com/joequery/Stupid-Table-Plugin/blob/master/stupidtable.js#L109

from stupid-table-plugin.

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.