import * as ko from "knockout"; import { whenDocumentReady } from "ojs/ojbootstrap"; import "ojs/ojknockout"; import Context = require("ojs/ojcontext"); import "ojs/ojdatagrid"; import { SampleDataGridProvider } from "./SampleDataGridProvider"; import { jsonData } from "./customers"; class ViewModel { public dataGridProvider = new SampleDataGridProvider({ dataArray: jsonData, columnHeaders: ["Last Name", "First Name", "Currency", "Card Type", "Card Number", "Company", "EIN", "Department", "Amount"], columnEndHeaders: ["last", "first", "cur", "type", "num", "org", "ein", "dept", "amt"], columnHeaderLabels: ["Classification", "Data Fields"] }); }; function init() { ko.applyBindings(new ViewModel(), document.getElementById('datagrid')); } whenDocumentReady().then(function () { // if running in a hybrid (e.g. Cordova) environment, we need to wait for the deviceready // event before executing any code that might interact with Cordova APIs or plugins. if (document.body.classList.contains('oj-hybrid')) { document.addEventListener('deviceready', init); } else { init(); } // release the application bootstrap busy state Context.getPageContext().getBusyContext().applicationBootstrapComplete(); });