Files
PetitTeton/public/admin/measureEditor.html

49 lines
1.1 KiB
HTML

<div id="measureEditor" class="page">
<h1>Measures</h1>
<table id="measureTable">
<colgroup>
<col width="*"></col>
<col width="30"></col>
<col width="*"></col>
</colgroup>
<thead>
<tr><th>Name</th><th>Visible</th><th>Postfix</th></tr>
</thead>
<tbody>
<tr> <td></td> <td></td> <td></td> </tr>
</tbody>
</table>
</div>
<runonce>
$("#measureTable").fancytree({
extensions: ["table"],
table: {
indentation: 20, // indent 20px per node level
nodeColumnIdx: 0
},
renderColumns: function(event, data) {
var node = data.node, $tdList = $(node.tr).find(">td");
$tdList.eq(1).html("<input type='checkbox' name='visible' value='" + node.visible + "'>");
$tdList.eq(2).text(node.data.postfix);
},
source: {
url: "/GetMeasures",
cache: false
},
postProcess: function(event, data) {
var nodes = data.response;
for(var i = 0; i < nodes.length; i++) {
nodes[i].key = (data.node != null ? data.node.key + "/" : "") + nodes[i].id;
nodes[i].title = nodes[i].name;
nodes[i].cache = false;
nodes[i].lazy = nodes[i].folder = false;
}
}
});
</runonce>