kendo ui - Uncaught TypeError: Cannot read property 'replace' of undefined with KendoTreeView` -
below kendoui tree view, using templates show edit link on each node, getting error: "uncaught typeerror: cannot read property 'replace' of undefined "
@section scripts{ <script src="~/scripts/kendo.all.min.js"></script> <script type="text/javascript"> var territory = new kendo.data.hierarchicaldatasource({ transport: { read: { type:'post', url: rooturl + "territory/allterritories", datatype: "json" } }, schema: { model: { id: "id", haschildren: "haschildren", children: territory } } }); $("#treeview").kendotreeview({ datasource: territory, datatextfield: "name", datavaluefield: "id", template: kendo.template($("#treeview-template").html()) }); </script> } <script id="treeview-template" type="text/kendo-ui-template"> # <a class='show-link' href='\#'><image src="/content/images/select2.png"></a> # </script> <style scoped> #territorytree { text-align: center; } #treeview .k-sprite { background-image: url("../content/default/coloricons-sprite.png"); } .rootfolder { background-position: 0 0; } .demo-section { display: inline-block; vertical-align: text-bottom; min-width: 320px; min-height: 300px; text-align: left; margin: 0 2em; } </style>
any solutions?? please help
jquery can't find element id #treeview-template
when
kendo.template($("#treeview-template").html())
then first try find html element id #treeview-template
, move forward. try f12 , console writing $("#treeview-template").html()
in console see if can or cannot find element
Comments
Post a Comment