24be6abb
Luigi Serra
selection control...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<html>
<head>
<script src="../../js/jquery-1.11.2.min.js"></script>
<script src="../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="../tree-view-controllet.html" />
</head>
<body>
<style>
#container {
width: 300px;
height: 100vh;
overflow: auto;
}
#fields {
height: 30px;
background-color: #2196F3;
}
</style>
<p id="fields"> </p>
<div id="container">
<tree-view-controllet id="tree" root-name="data" opened-path="data,records"></tree-view-controllet>
</div>
<script>
var tree = document.getElementById('tree');
var fields = document.getElementById('fields');
$.ajax({
url: 'https://data.issy.com/api/records/1.0/search?dataset=liste-des-restaurants-a-issy-les-moulineaux&sort=type&facet=type&facet=terrasse',
dataType: "json",
success: function(data){
tree.setAttribute("json-data", JSON.stringify(data));
tree.init();//chrome
}
});
tree.addEventListener("click", function () {
fields.innerHTML = tree.getFlatFields();
console.log(tree.getFlatFields());
console.log(tree.getFields());//firefox console.log does not recognize associative array?
});
</script>
</body>
</html>
<!--urls:-->
<!--url: 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=5',-->
<!--url: 'https://data.issy.com/api/records/1.0/search?dataset=liste-des-restaurants-a-issy-les-moulineaux&sort=type&facet=type&facet=terrasse',-->
<!--url: 'https://data.issy.com/api/records/1.0/search?dataset=flux-rss-des-offres-demplois-a-issy-les-moulineaux&sort=published&facet=published&refine.published=2015',-->
|