- 注册时间
- 2012-7-24
- 最后登录
- 2013-7-25
- 阅读权限
- 10
- 积分
- 160
- 精华
- 0
- 帖子
- 52
|
这是整段script代码
最上面我已经parse()过了
<script type="text/javascript">
mini.parse();
// init layout
var layout = mini.get("layout");
// init grid1
var grid = mini.get("datagrid");
var page1 = mini.get("pager1");
grid.bindPager(page1);
grid.hideColumn("id");
grid.load();
// init grid2
var idc = mini.get("idc");
var page2 = mini.get("pager2");
idc.bindPager(page2);
idc.hideColumn("id");
idc.load();
function getTracingData(){
var row = grid.getSelected();
if(row == null || row == "underfined")
row = grid.getSelected();
$.ajax({
type : 'post',
url : 'tracertServlet',
data : { id : row.id },
success:function(data){
var message = [];
message = data.split("&");
var str = '<table algin="center" border="0" cellpadding="3" cellspacing="1" width="100%" align="center" style="background-color: #b9d8f3;">';
for(var i=0;i<message.length;i++){
message[i].trim();
str += "<tr>";
str += "<td>"+message[i]+"</td>";
str += "</tr>";
}
str += "</table>";
mini.showMessageBox({
width:1000,
title:'探测数据',
buttons:['ok'],
message:str,
iconCls:""
});
}
});
}
var idc = mini.get("idc");
function getIdcTracingData(){
var row = idc.getSelected();
if(row == null || row == "underfined")
row = idc.getSelected();
$.ajax({
type : 'post',
url : 'tracertServlet',
data : { id : row.id },
success:function(data){
var message = [];
message = data.split("&");
var str = '<table algin="center" border="0" cellpadding="3" cellspacing="1" width="100%" align="center" style="background-color: #b9d8f3;">';
for(var i=0;i<message.length;i++){
message[i].trim();
str += "<tr>";
str += "<td>"+message[i]+"</td>";
str += "</tr>";
}
str += "</table>";
mini.showMessageBox({
width:1000,
title:'探测数据',
buttons:['ok'],
message:str,
iconCls:""
});
}
});
}
function searchServerByIdcId(ip,id,name){
if(window.confirm ( '您选中'+name+'机房')){
$('#idc_name').html("当前链路数据为:<font style='color:blue;'> "+name+" </font>");
idc.load({
"ip":ip
});
}else{
return;
}
}
var idc1 = mini.get("idc1");
var idc2 = mini.get("idc2");
function SourceIdcOnChange(e){
var ip = idc1.getValue();
idc2.setValue("");
idc2.url = "sourceServlet?source="+ip;
alert(idc2.url);
}
function IDC_Search(){
var idc1 = mini.get("idc1").getValue();
var idc2 = mini.get("idc2").getValue();
var time = mini.get("time").getValue();
if(idc1 == "" || idc2 == "" || time == ""){
alert("查询条件不能为空!");
return;
}else{
var now = new Date();
var before = new Date(2012,6,24,00,00,00);
if(time > now || time < before){
alert("时间应在2012-07-24 至 系统当前时间范围内!");
return;
}
if(idc1 == idc2){
alert("不能选择相同idc!");
return;
}
var searchTime = mini.get("time").getText();
mini.open({
url: "http://10.0.1.20:8080/idcsearch/Search.php?sip="+idc1+"&dip="+idc2+"&sdate="+searchTime,
title: "查询结果", width:1600, height:770,
allowResize : false,
showShadow : false,
onload:function(){
var iframe = this.getIFrameEl();
iframe.focus();
}
});
}
}
</script> |
|