GithubHelp home page GithubHelp logo

Comments (11)

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

Maybe it's an issue with autopublish. Can you try updating all dependencies and removing autopublish before dig in into this problem

from orioncms.

desertjinn avatar desertjinn commented on July 30, 2024

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.

from orioncms.

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

Ok. I will fix this tonight

from orioncms.

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

Sorry, aldeed:tabular is too buggy. I'm thinking in changing it.

from orioncms.

desertjinn avatar desertjinn commented on July 30, 2024

Hope you find something suitable soon, your package is truly an awesome addition to meteor.

from orioncms.

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

Didn't fix aldeed:tabular but I did a trick to make it work.
PD: aldeed:tabular it's not entirely buggy, but in the tracker topic yes it is

from orioncms.

desertjinn avatar desertjinn commented on July 30, 2024

Updated the package, the edit/delete buttons are gone from the table but I am able to edit and delete by selecting the table element 👍 . Nice fix.

New issue :
I had a select option specified using the format

{value:'labelvalue',label:'labelname'} 

and this worked before the update. After updating, no values are available for the select box.
screenshot from 2015-01-20 20 01 49

from orioncms.

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

Sorry, I was using the submit button the wrong way.

from orioncms.

desertjinn avatar desertjinn commented on July 30, 2024

It works!! 👍

P.S - I have a doubt.
When setting up select box, supplying values in the format {value:'labelvalue',label:'labelname'}, everything works perfectly. 👍

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?

from orioncms.

nicolaslopezj avatar nicolaslopezj commented on July 30, 2024

It's because you are not subscribed.
Add this line of code in the client

orion.admin.addAdminSubscription(orion.subs.subscribe('entity', 'venues'));

This will subscribe to that entity on every route of the admin

from orioncms.

desertjinn avatar desertjinn commented on July 30, 2024

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.

from orioncms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.