Code:
function g_checkStatus() {
/*this.statusDialog = new oldi.statusWindow.dialog();
this.statusDialog.create(g_checkStatus.arguments);
this.statusDialog.caller = null;
this.statusDialog.onShow(g_checkStatus.arguments);*/
alert('testing');
}
/* located inside a javascript object */
/* all this is doing is creating a grid and i'm adding the onclick event into the <div> */
loadTriggersComplete: function(type, data)
{
// remove rows from Trigger grid
this.trigGrid.model.clearData();
this.trigGrid.update();
if(data)
{
var model = this.trigGrid.model;
var trigs = [];
dojo.lang.forEach(data, function(stats)
{
var oc1 = 'onclick="g_checkStatus(\'trigger\', \'' + stats.Name + '\', \'' + stats.CompareTag1REC + '\', \'' + stats.CompareTag1ErrStr + '\', \'' + stats.CompareTag1EH1 + '\', \'' + stats.CompareTag1EH2 + '\', \'' + stats.CompareTag1EH3 + '\', \'' + stats.CompareTag1EH4 + '\', \'' + stats.CompareTag1EH5 + '\', \'' + stats.CompareTag1EH6 + '\', \'' + stats.CompareTag1EH7 + '\', \'' + stats.CompareTag1EH8 + '\', 1);"';
var oc2 = 'onclick="g_checkStatus(\'trigger\', \'' + stats.Name + '\', \'' + stats.CompareTag2REC + '\', \'' + stats.CompareTag2ErrStr + '\', \'' + stats.CompareTag2EH1 + '\', \'' + stats.CompareTag2EH2 + '\', \'' + stats.CompareTag2EH3 + '\', \'' + stats.CompareTag2EH4 + '\', \'' + stats.CompareTag2EH5 + '\', \'' + stats.CompareTag2EH6 + '\', \'' + stats.CompareTag2EH7 + '\', \'' + stats.CompareTag2EH8 + '\', 2);"';
var compTag1 = (stats.CompareTag1EF > 0) ? '<div ' + oc1 +' id="' + stats.Name + '_Tag1" class="cell-button-red">Status</div>' : '<div ' + oc1 +' id="' + stats.Name + '_Tag1" class="cell-button-gray">Status</div>';
var compTag2 = (stats.CompareTag2EF > 0) ? '<div ' + oc2 +' id="' + stats.Name + '_Tag2" class="cell-button-red">Status</div>' : '<div ' + oc2 +' id="' + stats.Name + '_Tag2" class="cell-button-gray">Status</div>';
var esf = (stats.ErrorStateFlag > 0) ? 'True' : 'False';
var newRowData = [stats.Name, stats.ExeCnt, stats.IoErrCnt, stats.AvgExeMs, stats.MinExeMs, stats.MaxExeMs, stats.AvgCycleMs, stats.MinCycleMs, stats.MaxCycleMs, esf, compTag1, compTag2];
model.insert(newRowData, model.count);
trigs.push([stats.Name, stats.ExeCnt]);
});
this.trigGrid.update();
}
else
{
dojo.debug("Error: Unable to get Trigger Status!");
}
},
Bookmarks