meteor-tabular
meteor-tabular copied to clipboard
Support searching on joined data
I am using this package to render data from one collection, I have also tried collection helpers, but failed to join 2 collections, Can you give some simple example which shows how to join and display the data table using the 2 collections.
Thanks and Regards, Manu
I'm also interested in this, thanks
Hi Gabriel,
Actually I have managed to achieve it using these packages :
reywood:publish-composite dburles:collection-helpers
Please refer : https://github.com/aldeed/meteor-tabular#using-a-custom-publish-function
But the issue that I a facing right now that while searching the records from joined collection are not working correctly in table search.
You can try this and let me know if this works for you.
Thanks, Manu
Sorry for the inconvenience , @manusharma1 can you help me with my problem? https://github.com/aldeed/meteor-tabular/issues/218
Hi Djeimi, Have a look into my suggestion here:
https://github.com/aldeed/meteor-tabular/issues/218#issuecomment-147968699
Hope it will help you, Please let me know if you are able to solve this at your end,
Thanks, Manu
Yes, searching or sorting on joined data isn't currently possible. I am thinking about ways that simple joins might be supported for search.
@aldeed basically, if you use publishComposite or anything similar, anything in the child cursor isn't searched over, correct?
Hi @aldeed
Do we have some solution to this issue now?
Thanks and Best Regards, Manu
I am also interested in this.
Denormalization would be a solution, but we it adds a lot complexity... plus I find for denormalizing data there is NO package available that makes it easy.... it there only was then we could easily implement a highly searchable datatable with tabular.
This is my denormalization package suggestion: https://forums.meteor.com/t/who-would-be-interested-in-a-denormalization-package-for-simpleschema-collection-2/27201
Hi @aldeed ,
I think we need to have some solution to resolve this issue as we are unable to use this package in many cases, search is important aspect of datatable and we need to have this working properly in case we are using joins.
Please try to have some solution soon.
Thanks and Best Regards, Manu
Hi guys,
just letting you know that I have created a package as a solution for this problem. It's in early beta and I am looking for feedback. Try it out at https://atmospherejs.com/thebarty/denormalized-views
Why wouldn't the DataTables render function work for sorting and filtering like demonstrated below? It works for properly displaying the transformed data, but when I try to sort or filter, it is not behaving as expected. Firstly, when filtering, the value passed in "type" to the render function is "type" rather than "filter". Any of the "transformed" strings are not returned. Sorting appears to sort on the user_id rather than on the transformed string.
registrationTable.registrationsList = new Tabular.Table({
name: 'registrationsList',
collection: Registrations,
responsive: true,
autoWidth: false,
columns: [
{
title: 'ID',
data: '_id'
},{
title: 'Firstname',
data: 'user_id',
render: function(data, type){
const user = Meteor.users.findOne(data, {fields: {"profile.firstName": 1}});
return user.profile.firstName;
}
}
},{
title: 'Lastname',
data: 'user_id',
render: function(data, type){
const user = Meteor.users.findOne(data, {fields: {"profile.lastName": 1}});
return user.profile.lastName;
}
}
]
});
Just a quick note here which might help someone else.
I've encountered the same problem when trying to search through a collection helper column.
However this collection helper is a simple join of two scheme fields as mentioned in the example. My small workaround has been to include the two columns separately while hiding them and search has been working for me again.
columns: [
{
data: 'firstName'
visible: false
}
{
data: 'lastName'
visible: false
...