This is a migrated thread and some comments may be shown as answers.

TreeList column template

1 Answer 103 Views
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 08 Jul 2020, 05:26 PM
What's the syntax for a treelist template column?  I can't find any examples anywhere.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Jul 2020, 11:36 AM

Hello Steve,

The syntax is as follows:

- The markup:

<kendo-treelist-column :field="'Position'" :width="140" :template="colorTemplate"></kendo-treelist-column>

- The template handler:

new Vue({
    el: "#vueapp",
    data: {
      colorTemplate: "# if (Position == 'CEO') { # <span class='not-valid'> #= Position # </span> # } else { # #= Position # # } #",
            localData: [] // data
        }
})

I have prepared a small StackBlitz demo demonstrating the above. Please examine it and let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Nikolay
Telerik team
Share this question
or