?
Solved

reset/delete cookie of jQuery Tablesorter Cookie Widget

Posted on 2009-07-11
5
Medium Priority
?
1,074 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 2000 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

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.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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)
Suggested Courses

801 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