How can I change the tree's color?

Kyle

Well, I "created" a little tree with two parents and three children using JqTree, and now I would like to change the properties of it, such as color, border and so on, but I do not want to change the library. Can you help me?

Thanks in advance.

var ExampleData = {};

ExampleData.data = [{
  label: 'node1',
  id: 1,
  children: [{
    label: 'child1',
    id: 2
  }, {
    label: 'child2',
    id: 3
  }]
}, {
  label: 'node2',
  id: 4,
  children: [{
    label: 'child3',
    id: 5
  }]
}];

ExampleData.getFirstLevelData = function(nodes) {
  if (!nodes) {
    nodes = ExampleData.example_data;
  }

  var data = [];

  $.each(nodes, function() {
    var node = {
      label: this.label,
      id: this.id
    };

    if (this.children) {
      node.load_on_demand = true;
    }

    data.push(node);
  });

  return data;
}

ExampleData.getChildrenOfNode = function(node_id) {
  var result = null;

  function iterate(nodes) {
    $.each(nodes, function() {
      if (result) {
        return;
      } else {
        if (this.id == node_id) {
          result = this;
        }

        if (this.children) {
          iterate(this.children);
        }
      }
    });
  }

  iterate(ExampleData.example_data);

  return ExampleData.getFirstLevelData(result.children);
}

$('#tree1').tree({
  data: ExampleData.data,
  autoOpen: false,
  dragAndDrop: true

});
		#navdata {

		  width: auto;

		  height: auto;

		  flex: 1;

		  padding-bottom: 1px;

		}

		#navgrid {

		  width: 50%;

		  height: 200px;

		  overflow-x: visible;

		  overflow-y: scroll;

		  border: solid 1px #79B7E7;

		  background-color: #DDEBF7;

		}

		#header {

		  background-color: #79B7E7;

		  width: 100%;

		  text-align: center;

		  border: 1px solid white;

		}

		#tree {

		  background-color: #FF0000;

		}

		
<!DOCTYPE html>
<html>

<head>

  

</head>

<body>
  <div id="navgrid">
    <div id="header">Header</div>
    <div id="tree1"></div>
  </div>
</body>

</html>

aba

add following css for jqTree

level 1 :

.jqtree-tree .jqtree-title .jqtree-title-folder {
    color: aqua !important;
}

level2 :

.jqtree-tree .jqtree-title {
    color: bisque !important;
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I change an image's color in Titanium?

From Java

How can I change an icon and text's color on hover?

From Dev

How can I change the bootstrap's well color?

From Dev

how can I change LinearLayout's color with round corner in runtime?

From Dev

How can I change color of button's background

From Dev

How can I change Edit Text´s selection color?

From Dev

How can I change the bootstrap's well color?

From Dev

How can I change color of button's background

From Dev

href link color is globalized, how can I change a specific link's color?

From Java

Can I change the color of Font Awesome's icon color?

From Dev

how can I change the color of bootstrap checkbox?

From Dev

How can I change the color of label with * in text

From Dev

How can I change background color for the desktop?

From Dev

How can I change the color of a material in Unity?

From Dev

How can I change the toolbar color in Swift

From Dev

How can i change whitespace color in emacs?

From Dev

How can I change the color of the scrollbar in Android?

From Dev

How can I change the color of legend points?

From Dev

How can I Change Netbeans' Highlight Color?

From Dev

How can I change background color for the desktop?

From Dev

How can I change cursor color in Ubuntu?

From Dev

How can I change the color of icons?

From Dev

How can I change color in a row

From Dev

How can I change the color of label with * in text

From Dev

How can I change footer background color?

From Dev

How can i change hyperlink color with JQuery?

From Dev

How can I change the color of text in Word

From Dev

How I can change the color of a themed box?

From Dev

How can I change background color

Related Related

HotTag

Archive