update detail data

This commit is contained in:
fanfuxiaoran 2014-07-04 18:32:42 +08:00
parent 80c22f6085
commit 0a4a96559a
2 changed files with 10 additions and 10 deletions

View File

@ -103,6 +103,7 @@ body {
<th>Script</th>
<th>Successful</th>
<th>Total</th>
<th>detail</th>
</tr>
</thead>
<tbody>

View File

@ -2,6 +2,7 @@ function Behavior() {
this.addButton = "<img src='images/add.png' alt='details' title='details' class='show-detail'>";
this.deleteButton = "<img src='images/add.png' alt='details' title='details' class='delete-detail'>";
this.table = $("#url").DataTable();
this.table.column(5).visible(false);
this.loadBehaviorResults = function(testPlanId, scripts) {
var table = $("#url").DataTable();
var map = new HashMap();
@ -56,21 +57,19 @@ function Behavior() {
for ( var j = 0; j < behaviors.length; j++) {
var data = behaviors[j];
var rowNode=table.row.add([this.addButton,data.behaviorUrl,names[k],data.totalCount,data.successfulCount]);
rowNode.data(behaviors[i].detailStatusCodeResultModels);
var rowNode = table.row.add([ this.addButton, data.behaviorUrl,
names[k], data.totalCount, data.successfulCount ,data.detailStatusCodeResultModels]);
}
table.draw();
}
this.addEvent();
}
this.createDetailTable = function(behaviorData) {
this.createDetailTable = function(url,detailDatas) {
var theader = [ "url", "statusCode", "count", "contentLength",
"minResponseTime", "maxResponseTime",
"totalResponseTimeThisTime" ];
var table = $("<table></table>");
var url = behaviorData.url;
var detailDatas = behaviorData.detailStatusCodeResultModels;
table.addClass("innerTable");
var thead = $("<thead></thead>");
var tr = $("<tr></tr>");
@ -104,11 +103,11 @@ function Behavior() {
this.addEvent = function() {
var behavior = this;
$(".show-detail").click(function() {
var tr = $(this).closest('tr');
var row = behavior.table.row(tr);
row.child(behavior.createDetailTable(row.data())).show();
var tr = $(this).closest('tr');
var row = behavior.table.row(tr);
row.child(behavior.createDetailTable(row.data()[0],row.data()[5])).show();
});
$(".delete-detail").click(function() {
var tr = $(this).closest('tr');