var JsonSearchTable = (function() { var JsonSearchTable = function(options) { this.jsonIndex = options.jsonIndex; this.recordToTableRow = options.recordToTableRow; this.colspan = options.colspan; this.queryId = options.queryId; this.tableId = options.tableId; this.searchStatusId = options.searchStatusId; this.moreId = options.moreId; window.addEvent('domready', this.initialize.bind(this)); }; JsonSearchTable.prototype.updateTable = function(result) { var table = document.getElementById(this.tableId); var tbody = document.createElement('tbody'); var tr, td, record, statusText = ''; document.getElementById(this.moreId).style.display = 'none'; if (!result) { } else if (result.records.length == 0) { tr = document.createElement('tr'); td = document.createElement('td'); td.setProperty('colspan', this.colspan); td.appendChild(document.createTextNode('No results match your query.')); tr.appendChild(td); tbody.appendChild(tr); } else { var records = result.records; for (var i=0; i