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

Template in tableColumns from AdminConfig does not show up #301

Open krishnaff opened 8 years ago

krishnaff commented 8 years ago

Hello, I'm unable to figure out why the template: 'showProductImage' does not show in the admin table view. I'm just trying to show the image using that template (data is right there, so there's no subscription problem)

AdminConfig = {
    collections: {
        Products: {
            color: 'red',
            tableColumns: [
                { label: 'Image', name: 'productImage', template: 'showProductImage' },
                { label: 'Title', name: 'title'}
            ],
            templates: {
                new: {
                    name: 'adminProductsNew'
                }
            }
        }
    }
};
<template name="showProductImage">
    <img src="{{actualimage}}" class="img-rounded">
</template>
//{{actualimage}} is returning this.value which shows the actual image URL if i console.log it from the helper function. But refuses to show up in the template! 

Any ideas what might be causing this? Thanks.

Victordmdb commented 8 years ago

@insaneinc01 Did you find a solution to this? I'm having the same issue. The template is not rendering at all, even with a static html label

krishnaff commented 8 years ago

@Victordmdb no luck! I couldn't find a solution till date. :(

smilansky commented 8 years ago

Im having the same problem, even though I know where the code is:

        columns = _.map collection.tableColumns, (column) ->
            if column.template
                createdCell = (node, cellData, rowData) ->
          $(node).html ''
                    Blaze.renderWithData(Template[column.template], {value: cellData, doc: rowData}, node)

Any modifications I make immediately throw an error of some sort - I really dont know how to use coffeescript properly.

michellarcari commented 8 years ago

Same here

ubercolin commented 8 years ago

I think this is due to deprecation warnings in how renderWithData is being used. You should be able to get around it by replacing the contents of that if statement with:

                createdCell = (node, cellData, rowData) ->
                    $(node).html(Blaze.toHTMLWithData Template[column.template], {value: cellData, doc: rowData})

Not really sure why the columns get rendered like this as the tabular tables code that drives this can take a template name, but this seemed like the smallest fix that gets it working again.