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

5 posts, 1 answers
  1. AJ
    AJ avatar
    2 posts
    Member since:
    May 2017

    Posted 07 Feb Link to this post

    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. Answer
    Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 08 Feb Link to this post

    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
  3. AJ
    AJ avatar
    2 posts
    Member since:
    May 2017

    Posted 08 Feb in reply to Plamen Link to this post

    This is perfect, exactly what I was looking for. And we're very excited to transition to the Native Grid! Thank you!
  4. Edmund
    Edmund avatar
    2 posts
    Member since:
    Apr 2019

    Posted 02 Apr in reply to Plamen Link to this post

    Plamen said: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 kissanime. 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-

    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

    Excellent tutorial and very well explained!

  5. Edmund
    Edmund avatar
    2 posts
    Member since:
    Apr 2019

    Posted 02 Apr in reply to Plamen Link to this post

    Plamen said: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 kissanime. 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-

    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

    Excellent tutorial and very well explained!

Back to Top