ludo/jquery-treetable — Issue #31: Options for cookie persistance
Author: guettli
Created: 2011-11-21 14:24:35+00:00
State: open

Hi,

here is a small patch to add options the the cookie persistance:
```patch
modwork_esg_d@workdevel114:~$ diff -u media/jquery-treetable/javascripts/jquery.treeTable.js-orig media/jquery-treetable/javascripts/jquery.treeTable.js
--- media/jquery-treetable/javascripts/jquery.treeTable.js-orig	2011-11-21 15:14:04.916003117 +0100
+++ media/jquery-treetable/javascripts/jquery.treeTable.js	2011-11-21 14:50:38.013003191 +0100
@@ -53,7 +53,8 @@
onNodeHide: null,
treeColumn: 0,
persist: false,
- persistCookiePrefix: 'treeTable_'
+ persistCookiePrefix: 'treeTable_',
+ persistCookieOptions: {}
};

// Recursively hide all node's children in a tree
@@ -150,7 +151,7 @@
if (options.persist) {
// Store cookie if this node is expanded, otherwise delete cookie.
var cookieName = options.persistCookiePrefix + $(this).attr('id');
- $.cookie(cookieName, $(this).hasClass('expanded') ? 'true' : null);
+ $.cookie(cookieName, $(this).hasClass('expanded') ? 'true' : null, options.persistCookieOptions);
}

return this;

```