Invalid template in kendo-list-view

3 posts, 1 answers
  1. Johann
    Johann avatar
    28 posts
    Member since:
    Jun 2015

    Posted 20 Nov 2015 Link to this post

    Hi,

     I develop a cordova application that runs on different devices. On Windows 10 it works ok but on IPhone i get the following error:

    Error: Invalid template:'<div class="lk_mitteilungen_liste_mitteilingsliste_list_view_item" style="cursor: pointer;"><span class="data-id" ng-bind="dataItem.id" style="display: none;"></span><table class="db-layout" style="width: 100%;"><tbody><tr><td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_titel" ng-bind="dataItem.titel" style=""></span></td></tr></tbody></table><table class="db-layout" style="width: 100%;"><tbody><tr><td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_gueltig" ng-bind="dataItem.gueltig" style=""></span></td></tr></tbody></table><hr style="padding: 0px; margin: 0px; border: 0px; border-bottom: 1px solid #e6e6e6; height: 1px; width: 100%;"></div>' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='<div class="lk_mitteilungen_liste_mitteilingsliste_list_view_item" style="cursor: pointer;"><span class="data-id" ng-bind="dataItem.id" style="display: none;"></span><table class="db-layout" style="width: 100%;"><tbody><tr><td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_titel" ng-bind="dataItem.titel" style=""></span></td></tr></tbody></table><table class="db-layout" style="width: 100%;"><tbody><tr><td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_gueltig" ng-bind="dataItem.gueltig" style=""></span></td></tr></tbody></table><hr style="padding: 0px; margin: 0px; border: 0px; border-bottom: 1px solid ';e6e6e6; height: 1px; width: 100%;"></div>;$kendoOutput+=;}return $kendoOutput;'

     Here is my original Code for this site:

    <kendo-list-view id="lk_mitteilungen_liste" k-data-source="termine" style="display: block; margin: 0px 0px 0px 0px;">
        <div  class="lk_mitteilungen_liste_mitteilingsliste_list_view_item" k-template style="cursor: pointer;">
            <span class="data-id" ng-bind="dataItem.id" style="display: none;"></span>
            <table class="db-layout" style="width: 100%;">
                <tbody>
                    <tr>
                        <td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_titel" ng-bind="dataItem.titel" style=""></span></td>
                    </tr>
                </tbody>
            </table>
            <table class="db-layout" style="width: 100%;">
                <tbody>
                    <tr>
                        <td style="width: 100% !important; padding: 0px 5px 5px 0px;"><span id="lk_mitteilungen_gueltig" ng-bind="dataItem.gueltig" style=""></span></td>
                    </tr>
                </tbody>
            </table>
            <hr style="padding: 0px; margin: 0px; border: 0px; border-bottom: 1px solid #e6e6e6; height: 1px; width: 100%;" />
        </div>
    </kendo-list-view>

     

    What is wrong with the Template?

    I use Kendo-UI with angularJS.

  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 24 Nov 2015 Link to this post

    Hi Johann,

    You have an unescaped "#" symbol in the template:

    <hr style="padding: 0px; margin: 0px; border: 0px; border-bottom: 1px solid #e6e6e6; height: 1px; width: 100%;" />


    Please check this help topic for more information:

      http://docs.telerik.com/kendo-ui/framework/templates/overview#escaping-hash-literals

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Johann
    Johann avatar
    28 posts
    Member since:
    Jun 2015

    Posted 26 Nov 2015 in reply to Alexander Valchev Link to this post

    Thx, it works now.
Back to Top