Skip to content

Table only updates when I update the fields from the first document #484

Description

@martinshhh

I'm using aldeed:autoform to validade and update my collection.
I have Reactive Table displaying all the documents of my collection. When I click on a row, I have iron:router to set the template data context with the document:

this.route('formulario', {
        path: '/tabelas/:_id',
        data: function() {
            return Adverts.findOne(this.params._id);
        }

that sends to a template with autoform where I update the data in my collection.

<template name="formularioUpdate">
    {{> quickForm collection="Adverts" doc=this id="formularioUpdate" type="update"}}
</template>

The problem is that if I update the second row, the document gets updated in Mongo but nothing happens in ReactiveTable, but If I delete or edit the first one, it gets updated.
My table.js and html

Template.imoveis.helpers({
    table: function() {
        return Adverts.find().fetch();
     },
});

Template.imoveis.events({
    'click #dwnldFiles': function() {
       Meteor.call('downloadUpdatedXML', listaImoveis ,function(error, xml){
        console.log(xml)
        // saveAs(new Blob([xml], { type: 'application/octet-stream' }), 'FicheiroConvertido.xml')
       });
    },
    'click .reactive-table tbody tr': function(event) {
        Router.go('formulario', {_id: this._id});
    }
});
<div>
        {{> reactiveTable collection=table}}
</div>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions