Hello. To display information from the collection of the data as a table I use the package “Reactive Table”. One of the information contained in the data collection is the “ID” of the user who writes the data to the data collection.
Using the code:
{key: 'osobaKolegiumId', label: 'Uczestnik kolegium', tmpl: Template._userUczestniczacyKolegium}
Displaying the value of the template “_userUczestniczacyKolegium”
The problem is that the built-in filter package “Reactive Table” does not filter data on the basis of the information contained in the template “_userUczestniczacyKolegium”
html file:
<template name="_userUczestniczacyKolegium">
{{author}}
</template>
js file:
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import './_user-uczestniczacy-kolegium.html';
Template._userUczestniczacyKolegium.onCreated( () => {
Template.instance().subscribe( 'usersProfile' );
});
Template._userUczestniczacyKolegium.helpers({
author: function () {
var osobaKolegiumId = Meteor.users.findOne({ _id: this.osobaKolegiumId });
return osobaKolegiumId.username;
}
});