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

Showing "yes" or "no" for a boolean field in a grid column

2 Answers 2379 Views
This is a migrated thread and some comments may be shown as answers.
AJ
Top achievements
Rank 1
AJ asked on 07 Feb 2019, 09:47 PM

I've found answers to this for other Kendo products, but I can't figure out the syntax for the Vue wrapper. I have a column in a grid that I want to show "yes" or "no" for based on the datasource value, which is boolean. This answer: https://www.telerik.com/forums/kendo-grid-showing-yes-or-no-instead-of-true-or-false specifies that I should do something like this:

columns: [
    { field: "BooleanVal", template: "#= BooleanVal ? 'yes' : 'no' #" }
]

I'm not using "columns", rather am using `<kendo-grid-column>`. I've tried several things along the lines of

<kendo-grid-column :field="active" :template="#= active ? 'yes' : 'no' #"></kendo-grid-column>

But nothing seems to work. How do I display "yes" or "no" for a boolean value in a kendo-grid-column?

2 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 08 Feb 2019, 06:26 AM
Hi,

In such case we recommend defining the template in the data section because the syntax of the prop in the HTML should be quite specific. Here is an example stackblitz. In this case we are using our Kendo jQuery templates.

I would also recommend you to review our new Vue Native Grid that is build with pure Vue code without a jQuery dependency and let us know if you have feedback about it. Here is an example where a similar thing is achieve with it by using Vue component for a template- https://stackblitz.com/edit/cznrh6?file=index.js.

Regards,
Plamen
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
AJ
Top achievements
Rank 1
answered on 08 Feb 2019, 05:28 PM
This is perfect, exactly what I was looking for. And we're very excited to transition to the Native Grid! Thank you!
Asked by
AJ
Top achievements
Rank 1
Answers by
Plamen
Telerik team
AJ
Top achievements
Rank 1
Share this question
or