Skip to content

Template with icon: possible to change image url dynamically? #463

@baden32

Description

@baden32

The json received with data (not develepped on my side) contains field "type" with a numeric value (1, 3,4, etc.).
This info represent a category and I would like to use template iconLeft in order add an icon according to this value.

In my Easycomplete options, I set this:

template: {
type: "iconLeft",
fields: {
iconSrc: "type"
}
},

As type is only containg a numeric value, no image can be displayed.

So is there a way to dynamically change the received value (in. 2) into a valid image url (ie. /files/images/2.png) ?

Thanks a lot for your help.
Joe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions