fix the testplan createtime problem
This commit is contained in:
parent
d263a914b9
commit
d38958ee0a
|
@ -25,24 +25,37 @@ function getColumn(obj, columnIndex) {
|
|||
}
|
||||
function extractRowData(data, tableModel, actionButton) {
|
||||
var dataArray = new Array();
|
||||
dataArray=getRowData(data, tableModel,dataArray);
|
||||
dataArray = getRowData(data, tableModel, dataArray);
|
||||
if (actionButton != null)
|
||||
dataArray.push(actionButton);
|
||||
return dataArray;
|
||||
}
|
||||
function extractRowDataActionBefore(data, tableModel, actionButton){
|
||||
function extractRowDataActionBefore(data, tableModel, actionButton) {
|
||||
var dataArray = new Array();
|
||||
if (actionButton != null)
|
||||
dataArray.push(actionButton);
|
||||
dataArray=getRowData(data, tableModel,dataArray);
|
||||
if (actionButton != null) {
|
||||
}
|
||||
dataArray.push(actionButton);
|
||||
dataArray = getRowData(data, tableModel, dataArray);
|
||||
return dataArray;
|
||||
}
|
||||
function getRowData(data, tableModel,dataArray){
|
||||
function getRowData(data, tableModel, dataArray) {
|
||||
for ( var i = 0; i < tableModel.length; i++) {
|
||||
for ( var key in data) {
|
||||
if (key == tableModel[i])
|
||||
dataArray.push(data[key]);
|
||||
if (key == tableModel[i]) {
|
||||
dataArray.push(formatToData(key, data[key]));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
// this need to change
|
||||
function formatToData(key, data) {
|
||||
if (key.indexOf("DateTime") >= 0) {
|
||||
var time = new Date(data);
|
||||
time.setTime(data);
|
||||
return time;
|
||||
}
|
||||
else return data;F
|
||||
}
|
|
@ -24,6 +24,7 @@ function loadTests(table, model,loadLength,actionButton) {
|
|||
loadLength=data.list.length;
|
||||
for ( var i = 0; i < loadLength; i++)
|
||||
table.dataTable().fnAddData(
|
||||
|
||||
extractRowData(data.list[i], model, actionButton));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue