grid-row-template with javascript code

1 Answer 22 Views
Grid
Gerardo
Top achievements
Rank 1
Iron
Veteran
Iron
Gerardo asked on 14 Jan 2025, 10:57 PM

Hi,

the following template is partially working when used in a grid-row-template. 


                <grid-row-template>
                    <div>${data.Name}</div>
                    #if(data.HasLastName){#
                          <div>${data.LastName}</div>
                    #} else {#
                          <div>some other stuff</div>
                    #}#
                </grid-row-template>

values inside ${ } are properly replaced, however the code inside # # is not executed, it is rendered as text. 

What is the proper way to include conditionals in this case?

 

regards

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 Jan 2025, 10:00 PM

Hello Gerardo,

 

Thank you for contacting us.

In this case the most straightforward approach would be to use a javascript template function. Can you share with me the full definition of the Grid so I can provide a sample for you?

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Gerardo
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Eyup
Telerik team
Share this question
or