Weird Behaviour

3 posts, 0 answers
  1. Wayne Hiller
    Wayne Hiller avatar
    37 posts
    Member since:
    Sep 2005

    Posted 24 Feb 2015 Link to this post

    I have a template that gets data bound. 

    <script type="text/x-kendo-template" id="filtering-template">
        <table class="edit-panel">
            <colgroup>
                <col class="fields-col">
                <col class="operator-col">
                <col class="value-col">
                <col class="delete-col">
            </colgroup>
            <tbody data-template="filtering-row-template" data-bind="source: filter.Rows"></tbody>
        </table>
        <a id="add-filter-row" data-role="button" data-bind="click: addRow">Add</a>
    </script>

    In this format the link at the bottom does not get set to a kendo button.
    If I change the order to this:

    <script type="text/x-kendo-template" id="filtering-template">
        <a id="add-filter-row" data-role="button" data-bind="click: addRow">Add</a>
        <table class="edit-panel">
            <colgroup>
                <col class="fields-col">
                <col class="operator-col">
                <col class="value-col">
                <col class="delete-col">
            </colgroup>
            <tbody data-template="filtering-row-template" data-bind="source: filter.Rows"></tbody>
        </table>
    </script>

    Then the button gets created correctly but the body of the table never gets created.

    There are no JS errors being displayed at all.







  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 25 Feb 2015 Link to this post

    Hi,

    the templates need a single root element to work as expected - try wrapping the two elements in a div.

    Regards,
    Petyo
    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. Wayne Hiller
    Wayne Hiller avatar
    37 posts
    Member since:
    Sep 2005

    Posted 25 Feb 2015 in reply to Petyo Link to this post

    That fixed it, Uggg, it was driving me nuts lol. You should put that in the docs in BIG red letters.

    Thanks you very much :)
Back to Top