c# - Uncaught TypeError: Cannot read property 'replace' of undefined -


I am new to using the Kendo grid and the Kindo UI. My question is how can I solve this error

The property can not read 'replace'. This is my code on my computer.

error

  rowTemplate: kendo.template ($ ("# rowTemplate"). Replace ('k-alt', ' ')),   

HTML of the line template

  & lt; Script id = "rowTemplate" type = "text / x-kendo-tmpl" & gt; & Lt; tr class = 'k-alt' & gt; & Lt; TD & gt; $ {First name} $ {last name} & lt; / Td> & Lt; / TR & gt; & Lt; / Script & gt;   

thanks :)

I think the element to jQuery can not be found .

Find the first element

  var rowTemplate = document.getElementsByName ("RowTemplate");   

or

  var rowTemplate = document.getElementById ("RowTemplate");   

or

  var rowTemplate = $ ('# rowTemplate');   

Then try your code again

rowTemplate.html (). Replace (....)

This question is already available:

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -