yogiben / meteor-admin

A complete admin dashboard solution
https://atmospherejs.com/yogiben/admin
GNU General Public License v3.0
827 stars 261 forks source link

Column template doesn't replace existing column value #229

Open nodren opened 9 years ago

nodren commented 9 years ago

When using the template option for tableColumns it's printing the value then printing what's inside my template

My Admin Config:

AdminConfig = {
    name: 'Tasks',
    adminEmails: ['test@example.com'],
    autoForm: {
        omitFields: ['createdAt', 'updatedAt'],
    },
    collections: {
        Tasks: {
            tableColumns: [
                { label: 'Task', name:'text' },
                { label: 'User', name: 'user()', template: 'AdminUserEmail' }
            ],
            extraFields: [
                'owner'
            ],
            color: 'red'
        }
    }
};

My Template:

<template name="AdminUserEmail">
    {{value.email}}
</template>

What the end result looks like: screen shot 2015-07-03 at 1 58 54 pm

As far as I know i'm doing everything exactly as I should according to the docs.

mordrax commented 9 years ago

This doesn't answer your question, but it may help you figure it out if you knew what was being passed to your template I use a global debug helper like this:

Template.registerHelper('debug', function (t) {
    console.dir(t);
    debugger;
});

and then wherever I want to know what's being passed to the template, i'd just call it like this:

<template name="AdminUserEmail">
    {{debug this}}
    {{value.email}}
</template>

With your chrome debugger on, it will break and show you what value and value.email contains. Hope this helps.

mpowaga commented 9 years ago

We fixed that bug and it will be released in the upcoming version. It should be this week.

HelloYie commented 8 years ago

+1 Now I use 1.2.* , but when I update to 1.26, It occured an error:

=> Errors while adding packages:             

While selecting package versions:
unknown package: isobuild:isopack-2
Required by: yogiben:admin 1.2.6