javascript - Cannot read property 'replace' of undefined in Kendo ListView -


i error

cannot read property 'replace' of undefined

when load grid. assume happens templateid not recognized. list view

 @(html.kendo().listview<docsviewmodel>()      .name("listview")             .tagname("div")             .clienttemplateid("documentlist")      ) 

and column keeps want have in listview

  columns.bound(od => od.documentlist).width(150).clienttemplate("#=generatetemplate(documentlist)#"); 

and javascript function

 function generatetemplate(documentlist) {          var template = "<ul>";         if (documentlist == null || documentlist == undefined) {              template = template + "<li> </li>";         } else {             (var = 0; < documentlist .length; i++) {                 var url = '@url.action("downloaddocument", "controller")?filename=' + documentlist [i];                 template = template + "<a href='" + url + "'>" + documentlist [i] + "</a> ";             }         }         return template + "</ul>";     } 

how can fix error? tried give listview templateid documentlist, undefined. need send somehow documentlist generatatetemplate function listview?


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -