Authored by simba

update

<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">Tables</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="widget-title">
<h5>Dynamic table</h5>
</div>
<div class="widget-content nopadding">
<div class="widget-title" style="height: 53px;">
<div>
<div class="form-inline" role="form" id="inBoxQueryDiv"
style=" margin-top: 12px;margin-left: 25px;float: left;">
<div class="input-group" style="float: left;">
<span class="input-group-addon">IP:</span>
<input type="text" id="" class="form-control" placeholder=""/>
</div>
<div class="input-group" style="float: left;">
<span class="input-group-addon">IP:</span>
<input type="text" id="" class="form-control" placeholder=""/>
</div>
<button id="submit" class="btn btn-default">搜索</button>
</div>
<button id="addBtn" class="btn btn-primary" style="margin-top: 12px;margin-left: 900px;">新增</button>
</div>
</div>
<div id="hostInfoTable">
</div>
</div>
</div>
</div>
<script>
$(function () {
//加载表格
$("#hostInfoTable").table({
columnAutoWidth : false,
url : contextPath+"/hostInfo/getHostInfos",
striped : true,
title : "主机信息列表",
pagination : true,
pageSize : 10,
loadFilter : function(data) {
return defaultLoadFilter(data);
},
columns : [{
title : "ID",
field : "id",
width : "5%"
}, {
title : "主机别名",
field : "alias",
width : "8%"
}, {
title : "IP",
field : "ip",
width : "10%"
}, {
title : "主机组名称",
field : "groupName",
width : "5%"
}, {
title : "机器类型",
field : "cloudType",
formatter : function(value, rowData, rowIndex) {
if(value == 1){
return 'AWS';
} else if(value == 2){
return '腾讯云';
}else{
return '其他';
}
},
width : "12%"
}, {
title : "操作",
field : "op",
width : "15%"
}]
});
});
</script>
\ No newline at end of file
... ...