Solved

reset/delete cookie of jQuery Tablesorter Cookie Widget

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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)

816 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

11 Experts available now in Live!

Get 1:1 Help Now