Giter VIP home page Giter VIP logo

Comments (7)

joequery avatar joequery commented on July 30, 2024

Hm, hadn't considered this before. Thanks for the issue.

from stupid-table-plugin.

jbrooksuk avatar jbrooksuk commented on July 30, 2024

I'm guessing you'd need to store the original sort somehow. 

Sent from Mailbox for iPhone

On Fri, May 10, 2013 at 9:34 PM, Joseph McCullough
[email protected] wrote:

Hm, hadn't considered this before. Thanks for the issue.

Reply to this email directly or view it on GitHub:
#62 (comment)

from stupid-table-plugin.

joequery avatar joequery commented on July 30, 2024

I'm not sure how this idea would be performance wise, but you could store the html of the table before you invoke the plugin, and then do a $("#mytable").html(oldTableHTML) whenever you want to get the original table back.

from stupid-table-plugin.

jbrooksuk avatar jbrooksuk commented on July 30, 2024

Oh no, that can't be a good way of doing it. 

For now, since I'm using backbone I refresh my collection and the table gets redrawn which is useful since its multiple user based. 

Sent from Mailbox for iPhone

On Fri, May 10, 2013 at 9:46 PM, Joseph McCullough
[email protected] wrote:

I'm not sure how this idea would be performance wise, but you could store the html of the table before you invoke the plugin, and then do a $("#mytable").html(oldTableHTML) whenever you want to get the original table back.

Reply to this email directly or view it on GitHub:
#62 (comment)

from stupid-table-plugin.

joequery avatar joequery commented on July 30, 2024

I'm just thinking of ways to solve the problems without making modifications to the plugin. My goal is to keep the plugin as small and readable (and thus modifiable) as possible. I don't want to add in a new feature if it can be accomplished outside of the plugin itself.

from stupid-table-plugin.

svivian avatar svivian commented on July 30, 2024

I don't know of any other plugins doing this.

One easy method to accomplish it though is to add a column to the left with a number for each row, i.e. 1, 2, 3, 4 and sort by that initially. Then the user can go back and sort by that to "reset" the table.

from stupid-table-plugin.

DanielBadan avatar DanielBadan commented on July 30, 2024

May be a bit out of topic but if I'm correct the way where sort starts are event listeners of elements with data-sort event. How about creating an unique id on sort initialization and use it to name('click.id') events, then provide an destroy method...use the id to remove event listeners and clear rest of the stuff.

The problem that exists now is that without a destroy method, even after you delete the table from the DOM it still remains in the JS memory because of referencing from the plugin.
Here's a bit more info about that: https://developers.google.com/web/tools/chrome-devtools/profile/memory-problems/memory-diagnosis

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.