var DataLoader = new function(){
this.buildHandsOnTable = function(returnVals, tableName){
DataLoader.data = $.parseJSON(returnVals);
DataLoader.tableName = tableName;
var dataLoadingTab = document.getElementById("dataLoadingTab");
var container = document.createElement("div");
var containerName = "dataLoadingTab-" + tableName;
container.setAttribute("id", containerName);
if ( dataLoadingTab.childElementCount != 0 ){
$('#dataLoadingTab').empty();
DataLoader.tableStack.pop();
}
dataLoadingTab.appendChild(container);
DataLoader.tableStack.push(containerName);
handsOnTable = new Handsontable(container, {
autoColumnSize: true,
data: DataLoader.data,
columns: tableColumns[tableName],
colWidths: 150,
rowHeaders: true,
colHeaders: DataLoader.tableHeaders[tableName],
minSpareRows: 1,
columnSorting: true,
sortIndicator: true,
manualColumnFreeze: true,
contextMenu: ['remove_row', 'hidden_columns_show', 'hidden_columns_hide', 'hidden_rows_show', 'hidden_rows_hide', 'undo', 'redo', 'alignment'],
hiddenColumns: {
indicators: true,
copyPasteEnabled:false
},
hiddenRows: {
indicators: true,
copyPasteEnabled:false
},
manualColumnResize: true,
licenseKey: '0000',
filters: true,
afterGetColHeader: addInput,
beforeOnCellMouseDown: doNotSelectColumn
});
};
this.addRow = function() {
var dataLength = DataLoader.data.length - 1;
handsOnTable.selectCell(555,7,555,7);
}
};