BDG Scenario 3

GroupList.js

window.onload = window_onLoad;
document.onkeypress = document_onKeyPress;

function window_onLoad() {
   var xml = '../Scripts/viewData.asp?tableName=group&fieldList=GroupId,Name&sortBy=Name';
   var id = getParam('id');
   if (id != null) xml = xml + '&whereID=' + id;
   var pid = getParam('pid');
   if (pid != null) xml = '../Scripts/viewData.asp?procName=lw_getSchedule&personId=' + pid;
   xmldso.XMLDocument.ondataavailable = doLoad;
   xmldso.XMLDocument.load(xml);
}

function formatCell(row) {
   return '<SPAN STYLE="display:none">' + row.cells[0].innerText + '</SPAN>' +
          '<IMG border="0" width="24" height="24" src="../images/group.gif" align="left" hspace="4">' +
          '<SPAN>' + row.cells[1].innerText + '</SPAN>';
}

function selectCell(elem) {
   var id = elem.firstChild.innerText;
   parent.frames("RIGHTPANE").window.load(id);
}

function search() {
   var term = frmSearch.searchTerm.value;
   if (term != "") {
      resetRows();
      var xml = '../Scripts/viewData.asp?tableName=group&fieldList=GroupId,Name&sortBy=Name&search=' + term;
      xmldso.XMLDocument.ondataavailable = noOp; // won't accept null
      xmldso.XMLDocument.onreadystatechange = dataAvailable;
      xmldso.XMLDocument.load(xml);
   }
   return false;
}

function document_onKeyPress() {
   // capture ENTER key, and call search function
   if (window.event.keyCode == 13)
      return search();
}