You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
521 B
21 lines
521 B
2 years ago
|
|
||
|
|
||
|
/* global document, grist, window */
|
||
|
|
||
|
grist.ready();
|
||
|
|
||
|
function readDoc() {
|
||
|
const api = grist.rpc.getStub("GristDocAPI@grist", grist.checkers.GristDocAPI);
|
||
|
const placeholder = document.getElementById('placeholder');
|
||
|
const fallback = setTimeout(() => {
|
||
|
placeholder.innerHTML = '<div id="output">no joy</div>';
|
||
|
}, 1000);
|
||
|
api.listTables()
|
||
|
.then(tables => {
|
||
|
clearTimeout(fallback);
|
||
|
placeholder.innerHTML = `<div id="output">${JSON.stringify(tables)}</div>`;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
window.onload = readDoc;
|