Solved

reset/delete cookie of jQuery Tablesorter Cookie Widget

Posted on 2009-07-11
5
1,063 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
ID: 24837064
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
ID: 24837066
Oh sorry for the inconsistency there. It should be $('#myTableId')
0
 

Author Comment

by:eaweb
ID: 24838984
Zyloch,
it works. thank you very very very much!!!
0
 

Author Comment

by:eaweb
ID: 24840336
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
ID: 24840509
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

707 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