-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity index table structure does not change when navigating between different entities #11
Comments
Maybe it's an issue with autopublish. Can you try updating all dependencies and removing autopublish before dig in into this problem |
I updated the dependencies and removed autopublish but index table structure is still behaving the same. The table structure of the first entity selected seems to persist while navigating between other entities. |
Ok. I will fix this tonight |
Sorry, |
Hope you find something suitable soon, your package is truly an awesome addition to meteor. |
Didn't fix |
Sorry, I was using the submit button the wrong way. |
It works!! 👍 P.S - I have a doubt. But I am setting the select box options by calling function getVenues() and returning all the values in the prescribed format. This just shows an empty select box now. This used to work fine before the update to 0.4.6. function getVenues() {
var venues = orion.entities.venues.collection.find().fetch();
var venuesmin = [];
_.each(venues,function(item){
venuesmin.push({value:item._id,label:""+item.title+""});
});
if(venuesmin)
return venuesmin;
return [];
} I configured the select box like this - orion.addEntity('sports', {
title: {
type: String,
label: "Sport Title",
},
venue: {
type: String,
label: "Venue",
optional: true,
autoform: {
type: 'select',
options :getVenues(),
}
},
}, {
icon: 'cubes',
sidebarName: 'Sports',
pluralName: 'Sports',
singularName: 'Sport',
tableColumns: [
{ data:'title', title: 'Sport' },
{
data:'venue',
title: 'Venue',
render: function(val, type, doc) {
var venuename = orion.entities.venues.collection.findOne({_id:doc.venue},{fields:{title:1}});
if(venuename) return venuename.title;
},
},
]
}); Specifically retrieving the venues entity collection gives me an empty array. var venues = orion.entities.venues.collection.find().fetch();
console.log(venues) //=> Array[0] Any ideas as to what I'm messing up? |
It's because you are not subscribed. orion.admin.addAdminSubscription(orion.subs.subscribe('entity', 'venues')); This will subscribe to that entity on every route of the admin |
Yes, that worked. I also had to tweak calling the function to populate options like this autoform: {
type: 'select',
options : function(){
var venues = orion.entities.venues.collection.find().fetch();
var venuesmin = [];
_.each(venues,function(item){
venuesmin.push({value:item._id,label:item.title});
});
if(venuesmin)
return venuesmin;
return [];
},
} prior to v0.4.6 I got the values by calling a function defined outside the entity. |
I have a few entities defined and each has its own individual structure for its index table.
This is an entity named 'sports' -
This is another entity named 'events' -
If I select 'sports' first and then switch to 'events' the index table ends up looking like this -
No console error messages are shown.
This only happens when navigating between entities.
Any idea why?
The text was updated successfully, but these errors were encountered: