maxazan / jquery-treegrid

TreeGrid plugin for jQuery
http://maxazan.github.io/jquery-treegrid
MIT License
553 stars 222 forks source link

Issue with saveState #62

Open Bears85 opened 7 years ago

Bears85 commented 7 years ago

Hi,

I am using django and supervisor/nginx to run my webserver. I have js-cookies in my static files (as well as a number of other items that are loaded without issue). For whatever reason, I cannot get saveState to cooperate. I am basically hanging on a blank load screen when I try to refresh the browser with saveState in the code block. If I remove saveState, everything works great.

Apologies if this isn't detailed enough, more of a weekend warrior with web dev.

Looking in DEBUG, I also see this: [12/Sep/2017 20:53:38] "GET /static/js-cookie/src/js.cookie.js HTTP/1.1" 304 0

Here is my code block loading this in:

<html lang="en">
  <head>
    <title> Temp </title>
    {% load staticfiles %}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="{% static 'favicon.ico' %}">
    <meta http-equiv="refresh" content="300">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="http://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.bootstrap.min.css">
    <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
    <script type="text/javascript" src="http://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/responsive/2.1.1/js/dataTables.responsive.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/responsive/2.1.1/js/responsive.bootstrap.min.js"></script>
    <script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="{% static '/jquery-treegrid/css/jquery.treegrid.css' %}">
    <script type="text/javascript" src="{% static '/jquery-treegrid/js/jquery.treegrid.js' %}"></script>
    <script type="text/javascript" src="{% static '/js-cookie/src/js.cookie.js' %}"></script>
    <script type="text/javascript" src="{% static '/jquery-treegrid/js/jquery.treegrid.bootstrap3.js' %}"></script>

    <style type="text/css">
      .hidden {display:none;}
    </style>
    <script type="text/javascript">
        window.onload = function(){
            document.getElementById("CurrentLink").href = window.location.toString();
        }
    </script>
    <script type="text/javascript">
    $(document).ready(function() {
        $('.tree').treegrid();
        $('.tree-2').treegrid({
            'initialState': 'collapsed',
            expanderExpandedClass: 'glyphicon glyphicon-minus',
            expanderCollapsedClass: 'glyphicon glyphicon-plus'
        });
    });
abdulrahman-khankan commented 6 years ago

Hi, try adding instead of js-cookie. Long shot but might be worth trying.