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

Template

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christophe
Top achievements
Rank 1
Christophe asked on 03 Apr 2019, 02:50 AM

I am really having time with anything I am trying with KendoUI library.

What is wrong with my template for a column ?

receiving this error: Uncaught Error: Invalid template:

columns: [
                {
                    template: "#if(quotation_number===null) {# <h5>something</h5> #} else {# #:quotation_number# #}#",

                    field: "quotation_number"

               },

 

thanks

2 Answers, 1 is accepted

Sort by
0
Christophe
Top achievements
Rank 1
answered on 03 Apr 2019, 02:58 AM

trying this give me this error: Uncaught ReferenceError: getQuoteId is not defined

 

function getQuoteId(id, quotation_number) {
    if (null===quotation_number) {
        return "B";
    } else {
        return "A";
    }
}

 

and in the grid

 

columns: [
                {
                    template: "#=getQuoteId(id, quotation_number)#",
                    field: "quotation_number"

 

 

0
Georgi
Telerik team
answered on 04 Apr 2019, 01:26 PM
Hello Christophe,

I have tested the very same template in the following sample but it seems to be working as expected:


Am I missing something?

Furthermore, the reference error occurs when the handler is not available within the global scope. Could you please make sure that the getQuoteId function is declared within the global scope?


Regards,
Georgi
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Christophe
Top achievements
Rank 1
Answers by
Christophe
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or