2008-10-29 13:57:19 +00:00
|
|
|
window.noderange="";
|
2008-10-23 23:28:09 +00:00
|
|
|
function updatenoderange() {
|
|
|
|
myselection=nrtree.selected_arr;
|
2008-10-29 13:57:19 +00:00
|
|
|
window.noderange="";
|
2008-10-23 23:28:09 +00:00
|
|
|
for (node in myselection) {
|
2008-10-29 13:57:19 +00:00
|
|
|
window.noderange+=myselection[node][0].id;
|
2008-10-23 23:28:09 +00:00
|
|
|
}
|
2008-10-29 13:57:19 +00:00
|
|
|
window.noderange=window.noderange.substring(1);
|
|
|
|
|
|
|
|
if (window.nodetabs) {
|
|
|
|
var index = window.nodetabs.data('selected.tabs');
|
|
|
|
// todo: figure out a better way to determine if the current tab is one of those that needs to be reloaded with the new noderange
|
|
|
|
if (index == 0) {
|
|
|
|
//alert('here');
|
|
|
|
//window.nodetabs.tabs('select', index); // simulate selecting it, so it reloads. Did not work.
|
|
|
|
loadAttrTab($('#attributes-tab'));
|
|
|
|
}
|
2008-11-19 21:26:43 +00:00
|
|
|
if (index == 2) {
|
|
|
|
loadVitalsTab($('#rvitals-tab'));
|
|
|
|
}
|
2008-10-29 13:57:19 +00:00
|
|
|
}
|
|
|
|
|
2008-10-23 23:28:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2008-10-29 13:57:19 +00:00
|
|
|
|
2008-10-23 23:28:09 +00:00
|
|
|
nrtree = new tree_component(); // -Tree begin
|
|
|
|
nrtree.init($("#nrtree"),{
|
2008-10-29 13:57:19 +00:00
|
|
|
rules: { multiple: "Ctrl" },
|
|
|
|
ui: { animation: 250 },
|
|
|
|
callback : { onchange : updatenoderange },
|
2008-10-23 23:28:09 +00:00
|
|
|
data : {
|
|
|
|
type : "json",
|
|
|
|
async : "true",
|
|
|
|
url: "noderangesource.php"
|
|
|
|
}
|
|
|
|
}); //Tree finish
|
|
|
|
});
|