meteor-admin icon indicating copy to clipboard operation
meteor-admin copied to clipboard

Template in tableColumns from AdminConfig does not show up

Open krishnaff opened this issue 10 years ago • 5 comments

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.

krishnaff avatar Nov 20 '15 04:11 krishnaff

@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

Victordmdb avatar Dec 08 '15 12:12 Victordmdb

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

krishnaff avatar Dec 08 '15 15:12 krishnaff

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.

smilansky avatar Feb 20 '16 00:02 smilansky

Same here

michellarcari avatar Feb 24 '16 16:02 michellarcari

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.

ubercolin avatar Mar 16 '16 17:03 ubercolin