dimanche 25 février 2018

ember.js list template keeps getting bigger on each visit

In an Emberjs 2.13.0 app I have a model that looks like this :

import DS from 'ember-data';

export default DS.Model.extend({
    cceIdentifierParent: DS.attr('string'),
    cchCceIdParent: DS.attr('string'),
    nodeType: DS.attr('number')
});

I have a route, 'diagcctreetoplevelonly', which looks like this :

import Ember from 'ember';

export default Ember.Route.extend({
    model: function() {
        return this.store.findAll('diagcctreetoplevelonly');
  }
});

And a template that looks like this :



  <table>
    <thead>
      <tr>
        <th>
            cceIdentifierParent
        </th>
        <th>
            cchCceIdParent
        </th>
        <th>
            nodeType          
        </th>
      </tr>
    </thead>
    <tbody>
        
           <tr>
              <td>
                
              </td>
              <td>
                
              </td>
              <td>
                
              </td>
            </tr>
        
    </tbody>
  </table>

  <p id="blankslate">
    No Tree Nodes found
  </p>



That works fine the first time that 'diagcctreetoplevelonly' is visited - 12 rows are rendered - but on subsequent visits (without the underlying data having changed) the table rendered by the template has 12 extra rows .




Aucun commentaire:

Enregistrer un commentaire