1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <meta charset="utf-8" />
5
  <title>Wialon Playground — Account Tree</title>
6
  <script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>
7
  <script type="text/javascript" src="https://hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
<div id='tree-view'></div>
12
13
<hr>
14
15
<div id='log'></div>
16
17
</body>
18
</html>
HTML
10
 
1
p { margin: 0; padding: 0; }
2
#tree-view p > span {
3
  cursor: pointer;
4
}
5
#tree-view .tree-view-not-expandable > p > span {
6
  cursor: auto;
7
}
8
#tree-view .tree-view-expandable {
9
  margin-bottom: 0.3em;
10
}
CSS
352
 
1
/*
2
 * Visualize account hierarchy via account_tree dynamic report
3
 *
4
 * Implementation:
5
 *   
6
 *   1. Load library 'resourceReports' by:
7
 *
8
 *        var session = wialon.core.Session.getInstance();
9
 *        session.loadLibrary('resourceReports');
10
 *
11
 *   2. Subscribe for resource list with billing properties:
12
 *
13
 *        var resourceFlags = wialon.item.Item.dataFlag.base | wialon.item.Resource.dataFlag.billingProps;
14
 *
15
 *        session.updateDataFlags([
16
 *          {type: 'type', data: 'avl_resource', flags: resourceFlags, mode: 0}
17
 *        ], callback);
JS
Result
Source code of example Close ✕
1
 
1
/*source*/