DOM as source: No data available in table
DOM as source: No data available in table
sifatnr
Posts: 3Questions: 2Answers: 0
Hi,
I have a Meteor app and when trying to use the DOM as the source, it says "No data available in table". In my HTML file I have:
<head>
<title>Logins</title>
</head>
<body>
<h1>Logins</h1>
{{> loginButtons}}
{{> loginstemplate}}
</body>
<template name="loginstemplate">
{{#if ready}}
<h1>External users logged in: {{countusers}}; Active: {{countactiveusers}}</h1>
<table id="example" class="display" width="70%">
<thead>
<tr>
<th>Username</th>
<th>Logged in?</th>
<th>Name</th>
<th>Firm</th>
<th>Region</th>
<th>Login time</th>
<th>Record type</th>
</tr>
</thead>
<tbody>
{{#each getlogin}}
<tr>
<td>{{Username}}</td>
<td>{{#if registeredatcheck}} Y {{/if}}</td>
<td>{{Name}}</td>
<td>{{Firm}}</td>
<td>{{Region}}</td>
<td>{{formatDate RegisteredAt}}</td>
<td>{{Recordtype}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{/if}}
</template>
And in my JS file:
$(document).ready(function() {
$('#example').DataTable();
} );
Is there any obvious reason why it cannot pick up the data from DOM? I've attached an image of how my table appears. Thanks.
This discussion has been closed.
Answers
I can only guess that
{{#each getlogin}}
doesn't have any data. Can you give me a link to the page so I can check?Thanks,
Allan
Hi Allan - I actually resolved this by implementing aldeed:tabular correctly. Thanks.