ListView + Drawer + custom template

3 posts, 0 answers
  1. Urban
    Urban avatar
    2 posts
    Member since:
    Nov 2013

    Posted 19 Nov 2013 Link to this post

    I'm useing Drawer and ListView and want ot add pull to refresh with custom template for ListView.
    This is the code:
    <script type="text/x-kendo-tmpl" id="pull-to-refresh-template">
        <div class="portpos">
            <a href="#drawer-drafts2?id=#:p_portfelj_id#">
                <span class="h3x">#:ime_portfelja#</span>       
                <div class="portfelj change #:trend#">
                    Današnja sprememba
                <big>#:tadan#</big>
                </div>
                <div class="portfelj state">
                <span class="title">Trenutna vrednost</span>
                <big>#:stanje#</big> <small>EUR</small>
             </div>
            </a>
        </div>
    </script>


    It produces JavaScript error, I assume beacause of hash for drawer. If I remove hash Javascript works but link bokes.

    Any ideas how to overcome this?
  2. Urban
    Urban avatar
    2 posts
    Member since:
    Nov 2013

    Posted 19 Nov 2013 Link to this post

    This is error:
    Error: Invalid template:'<li data-uid="#=arguments[0].uid || ""#"> <div class="portpos"> <a href="#drawer-drafts2?id=#:p_portfelj_id#"> <span class="h3x">#:ime_portfelja#</span> <div class="portfelj change #:trend#"> Današnja sprememba <big>#:tadan#</big> </div> <div class="portfelj state"> <span class="title">Trenutna vrednost</span> <big>#:stanje#</big> <small>EUR</small> </div> </a> </div> </li>'

    Generated code:'var o,e=kendo.htmlEncode;with(data){o='<
    li data-uid="'+(arguments[0].uid || "")+'">\n\t<div class="portpos">\n\t\t<a href="';drawer-drafts2?id=;o+=':p_portfelj_id';"> <span class="h3x">;o+=':ime_portfelja';</span> <div class="portfelj change ;o+=':trend';"> Današnja sprememba <big>;o+=':tadan';</big> </div> <div class="portfelj state"> <span class="title">Trenutna vrednost</span> <big>;o+=':stanje';</big> <small>EUR</small> </div> </a> </div> </li>;o+=;}return o;'
  3. Kendo UI is VS 2017 Ready
  4. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 20 Nov 2013 Link to this post

    Hi,

    please take a look at the Kendo UI templates overview help article - it features several examples relevant to your case.

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top