This is a migrated thread and some comments may be shown as answers.

ListView + Drawer + custom template

2 Answers 41 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Urban
Top achievements
Rank 1
Urban asked on 19 Nov 2013, 11:32 AM
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 Answers, 1 is accepted

Sort by
0
Urban
Top achievements
Rank 1
answered on 19 Nov 2013, 11:48 AM
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;'
0
Petyo
Telerik team
answered on 20 Nov 2013, 09:30 AM
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!
Tags
ListView (Mobile)
Asked by
Urban
Top achievements
Rank 1
Answers by
Urban
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or