Solved

jsTree cookies not working

Posted on 2013-12-18
2
757 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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

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…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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)

717 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