// Creates a Result Grid
function _CreateGrid(inObject)
{
document.write("<div id=\"divResultPopup\" class=\"result_popup\">");
// The grid
this.itsGrid = new AW.UI.Grid;
this.itsGrid.setId('gridResultPopup');
this.itsGrid.setColumnCount(2);
this.itsGrid.setRowCount(3);
this.itsGrid.setHeaderText(['Update','Result']);
this.itsGrid.setSize(300,100);
this.itsGrid.setColumnWidth(180,1);
this.itsGrid.setSelectionMode("single-row");
document.write("<p></p>"+this.itsGrid);
document.write("</div>");
hideDiv("divResultPopup");
}
function _LoadData(inIP, inOneResult, inTwoResult, inCFResult)
{
showDiv("divResultPopup");
this.itsGrid.setRowCount(3);
this.itsGrid.setCellText("One",0,0);
this.itsGrid.setCellText("Two",0,1);
this.itsGrid.setCellText("Custom Fields",0,2);
this.itsGrid.setCellText(inOneResult,1,0);
this.itsGrid.setCellText(inTwoPResult,1,1);
this.itsGrid.setCellText(inCFResult,1,2);
// Set the background
for (var i = 0; i < 3; i++)
{
var theColour;
if (this.itsGrid.getCellText(1,i).indexOf('Success: ') > -1)
theColour = 'CCFF33';
else if (this.itsGrid.getCellText(1,i).indexOf('Error: ') > -1)
theColour = 'FF4242';
else
theColour = 'FFFF80';
this.itsGrid.getRowTemplate(i).setStyle('background-color',theColour);
}
}
This topic is archived.