Solved

reset/delete cookie of jQuery Tablesorter Cookie Widget

Posted on 2009-07-11
5
1,051 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JavaScript waiting 14 71
Popup to change image and store url in database 2 31
jQuery - how can I set focus to first valid element in dropdown? 2 16
is this a cms? 8 36
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

863 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

23 Experts available now in Live!

Get 1:1 Help Now