Meteor app: Prevent data from disappearing

Meteor app: Prevent data from disappearing

sifatnrsifatnr Posts: 3Questions: 2Answers: 0
edited August 2016 in Free community support

Hi all,

I have a Meteor app and I setup Datatables using npm. The table works, but if I try searching for something, or trying to show 25 per page for example, all the data disappears. I think I need to somehow dynamically add data from Meteor?

My JS file has this code:

    $(document).ready(function() {
        $('#example').DataTable();
    } );

And my HTML file has this:

<template name="loginstemplate">
{{#if ready}}
    <h1>External users logged in: {{countusers}}; Active: {{countactiveusers}}</h1>

<table id="example" class="display" width="100%">
<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>

It renders the rows but after trying to search or view 25 per page, this happens: http://i63.tinypic.com/144a6uw.png

This discussion has been closed.