Listview template not executed

2 posts, 0 answers
  1. Alon
    Alon avatar
    8 posts
    Member since:
    Aug 2015

    Posted 28 Nov 2016 Link to this post

    I currently have the following template

     

        <script id="tmplOptionsMenuItemRowAll" type="text/x-kendo-tmpl" >
            <div>#:uid#</div>
            <div class="col-xs-12"
                data-role="listview"
                data-template="tmplOptionsMenuItemRowAll"
                data-bind="source: allMenuItems"
                data-selectable="false"
                id="kendoLVOptionsAllMenuItems">
            </div>
        </script>

     

    I am trying to manually calculate the HTML and then inserting it somewhere in the DOM (its a long story)

    I currently call the following code to do this:

                   var templateContent = $(options.templateId).html();

                    var template = kendo.template(templateContent);
                    //now resolve the HTML
                    var result = kendo.render(template, [options.appModel]); //render the template
                    return result;

     

    However when I look at 'result' I can see that the UID has been correctly resolve BUT the list view has not been executed at all. Am I missing something?

  2. Alon
    Alon avatar
    8 posts
    Member since:
    Aug 2015

    Posted 28 Nov 2016 Link to this post

    OK Never mind. I was able to get the HTML after I did the call to kendo.bind and the inject it into the DOM where I wanted it

    The code was as follows:

            kendo.bind($(options.divId), options.appModel);<br>        var templateContent = $(options.divId).html();
Back to Top