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
|
|
|
}
|
2009-06-04 07:30:24 +00:00
|
|
|
if (index == 3) {
|
|
|
|
loadRpowerTab($('#rpower-tab'));
|
|
|
|
}
|
2009-06-09 05:09:08 +00:00
|
|
|
if (index == 4) {
|
|
|
|
loadPingTab($('#ping-tab'));
|
|
|
|
}
|
2009-06-17 09:45:13 +00:00
|
|
|
if (index == 5) {
|
|
|
|
loadCopyTab($('#copy-tab'));
|
|
|
|
}
|
|
|
|
if (index == 6) {
|
|
|
|
loadSPCfgTab($('#spcfg-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
|
|
|
|
});
|