?
Solved

jsTree cookies not working

Posted on 2013-12-18
2
Medium Priority
?
762 Views
Last Modified: 2013-12-18
I think this is my 3rd question about jsTree and everything is starting to work great.  I have the tree going but when I select a node and the page refreshes all the nodes are closed.

This is the script I use for the tree

<script type="text/javascript">
           var uid = <%=  ViewData["uid"] %>
          $(function() {          
              $("#categories").jstree(
          {
              "themes": {
                  "theme": "classic",
                  "dots": true,
                  "icons": true
              },
              "json_data": {
                  "ajax": {
                      "url": "/Home/GetEmployeeInfo/"   }
              },

              "core": { "initially_open": uid },
              "ui": { "select_limit": 1 },
              "cookies": {"auto_save": true },
              "plugins": ["themes", "json_data", "ui", "cookies", "types"]


          })

	.bind("select_node.jstree", function(e, data) {		   
	    window.location.href = '/Details/Index/' + data.rslt.obj.attr("id");
          	})

          });
        
    </script>

Open in new window


Thank you in advance for any help
0
Comment
Question by:Niall292
[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
  • 2
2 Comments
 

Accepted Solution

by:
Niall292 earned 0 total points
ID: 39727470
Working with colleagues we still used cookies but also ajax and it worked great. So for anyone who might have the same problem here is what we did.

.bind("select_node.jstree", function(e, data) {		
            $.ajax({
                type:"GET",
                url:"/controller/action/" + data.rslt.obj.attr("id"),
                success: function(content) {
                    $("#content").html(content);
                }
            }); 

Open in new window

0
 

Author Closing Comment

by:Niall292
ID: 39727471
This was figured out with colleagues at work
0

Featured Post

Technology Partners: 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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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

765 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