code: function() {
              var $this = $(this);
              if ($this.treegrid('getSetting', 'saveStateMethod') === 'cookie') {
                  var stateArray = $.cookie($this.treegrid('getSetting', 'saveStateName')).split(',');
                  if ($.inArray($this.treegrid('getNodeId'), stateArray) !== -1) {
                      $this.treegrid('expand');
                  } else {
                      $this.treegrid('collapse');
                  }
  
              }
              return $this;
          }
docs: Restore state of current node.
  
  @returns {Node}