Solved

reset/delete cookie of jQuery Tablesorter Cookie Widget

Posted on 2009-07-11
5
1,048 Views
Last Modified: 2012-05-07
Hi,

I have a problem resetting or deleting cookie.

I don't know if one of you has already worked with this table sort with cookie. I am using the "jQuery Tablesorter Cookie Widget" ( http://www.jdempster.com/2007/08/13/jquery-tablesorter-cookie-widget/ ). It is working fine, but now i am in need for a way to give the user the opportunity to reset/delete the cookie by clicking on a link in the page and onclick execute a javascript function so that the table return to it's original state. Has someone already done this or know how to? ( http://www.jdempster.com/wp-content/uploads/2007/08/jquery.tablesorter.cookie.example.html )
Please some code help.
0
Comment
Question by:eaweb
  • 3
  • 2
5 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
Comment Utility
I have never used this before, so I do not know for sure. You can try to delete the cookie, however:

// Change ORIGINAL_SORT to your default sorting order.
 

var tablesorterCookieJar = $.cookieJar('tablesorter');

tablesorterCookieJar.remove('myTableId');

$('#myTable').trigger('sorton', ORIGINAL_SORT);

Open in new window

0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Oh sorry for the inconsistency there. It should be $('#myTableId')
0
 

Author Comment

by:eaweb
Comment Utility
Zyloch,
it works. thank you very very very much!!!
0
 

Author Comment

by:eaweb
Comment Utility
hi zyloch,
i am trying to sort on number with , like 1,107,748.90 but it is not doing it right.
i am getting the following:
1,107,748.90  
1,727.79  
10,050.86  
which is not good.
any idea where can i modify to get it right?
0
 

Author Comment

by:eaweb
Comment Utility
i also have a column with VETH92698 as account number together with account numbers of only numbers
exsample:
VETH92698
1002345
2343532
etc..
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now