Fawar
Fawar

Reputation: 735

TPL on List filled with Store

I can't get the following to work

{[displayDate(dateRelease);]} 

Each model from the store has the property "dateRelease"

I need to get that date and transform it with my displayDate() before displaying it.

When I write the code, I get the error that dateRelease is not found.

How should I proceed?

Upvotes: 0

Views: 75

Answers (2)

bwags
bwags

Reputation: 1008

See this question.

For your example it would look like:

itemTpl: new XTemplate(
    '<tpl>',
        '<p>{[this.displayDate(dateRelease)]}</p>',
    '</tpl>',
    {        
        displayDate: function(date){
            return runFunction(date);
        }
    }
);

I have not tested this syntax so there may be a typo.

Upvotes: 0

kevhender
kevhender

Reputation: 4405

Try using values.dateRelease.

Upvotes: 1

Related Questions