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

List view in conflict with kendo.data.min.js

2 Answers 51 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Sander
Top achievements
Rank 1
Sander asked on 04 Apr 2013, 06:05 PM
Hi,

I am creating an application which requires a listview with items coming from an external xml datasource.
This is what my datasource looks like:
01.var expenseFormDataSource = new kendo.data.DataSource({
02.        transport: {
03.            read: {
04.                url: EA.baseURL + "resources/expenseService/getExpenseForms",
05.                dataType: "xml",
06.                type: "POST"
07.            },
08.            parameterMap: function(options) {
09.                return {
10.                    token: EA.getToken()
11.                };
12.            }
13.        },
14.        schema: {
15.            type: "xml",
16.            data: "expenseForms/expenseForm",
17.            model: {
18.                fields: {
19.                    id: "id/text()",
20.                    date: "date/text()",
21.                    statusId: "statusId/text()"
22.                }
23.            }
24.        }
25.    });
A preview of the returned XML can be found in attachment.  (I want to create a listitem per expeseFrom).

The listview is created when the view is initalized.  Here is the code:
1.$("#expenseFormList").kendoMobileListView({
2.       dataSource: expenseFormDataSource,
3.       pullToRefresh: true,
4.       template: $("#expenseForm-template").text()
5.   });
The expenseFormList is an empty unordered list inside my view. The expenseFrom-template looks like this:
1.<script id="expenseForm-template" type="text/x-kendo-template">
2.    <a data-role="listview-link" id=#="\"my-expenses-show-pdf-" + id+ "\""#>
3.        <div class="expenseForm-date">#= kendo.toString(new Date(Date.parse(date)), "dd/MM/yyyy") #</div>
4.        <div class="expenseForm-status">Status: #= expenseStatusIdToString(statusId) #</div>
5.    </a>
6.</script>
This all works except when I include "kendo.data.min.js".  When I include the file,  the items in the list are not rendered and no error message is provided in Chrome Developers Tools.  The same issue also occured when I tried to follow the listview with pull-to-refresh tutorial:  no items when the file was included.
I have to include the JavaScript file for a Kendo dropdownlist,  somewhere else in my application.  
What should I do? 
Thanks!

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 08 Apr 2013, 08:50 AM
Hello Sander,

kendo.mobile.min.js contains kendo.data.min.js which is why you should not include it again. To include a Kendo DropDownList in your application, from the JavaScript dependencies you need only:
  • kendo.dropdownlist.js
  • kendo.list.js

Rest of the files are part of the kendo.mobile.min.js.
In order to avoid any potential errors, you may use kendo.all.min.js which contains all the required files or the custom download builder tool (available only for commercial licence owners).

I hope this information will help.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sander
Top achievements
Rank 1
answered on 10 Apr 2013, 07:11 PM
Hi Alexander,

Thanks for the response!

I managed to make my whole mobile application to work with just kendo.all.min.js.  I could not use the custom download tool because I only have a trial license.

Changing the kendo.mobile.min.js to kendo.all.min.js has some strange behaviour though.  It appeared that my bindings didn't worked anymore.  After a long search I found the remark that Kendo UI Mobile is not included in the default list of initialized namespaces.  Now I found the section of MVVM integration in mobile applications

I thought switching both JavaScripts would only affect the result and you did not have to change the code.  Now I see where I was wrong!

Thanks again!
Tags
ListView (Mobile)
Asked by
Sander
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Sander
Top achievements
Rank 1
Share this question
or