Hello,
I initialize a Kendo UI Mobile ListView like this :
In this case, it works well.
But, if I use the syntax below, it doesn't work at all (no data displayed). Why ?
Cordially,
Kakone.
I initialize a Kendo UI Mobile ListView like this :
var
projects =
new
kendo.data.DataSource({
type:
"odata"
,
transport: { read:
"http://localhost:50486/WcfDataService.svc/Projects"
}
});
$(
"#projectsListView"
).kendoMobileListView({
dataSource: projects,
style :
"inset"
,
template:
"${Number} - ${Label}"
,
});
But, if I use the syntax below, it doesn't work at all (no data displayed). Why ?
$(
"#projectsListView"
).kendoMobileListView();
var
lv = $(
"#projectsListView"
).data(
"kendoMobileListView"
);
lv.options.template =
"${Number} - ${Label}"
;
lv.options.style =
"inset"
;
lv.dataSource = projects;
lv.refresh();
Cordially,
Kakone.
5 Answers, 1 is accepted
0
Accepted
Hi,
This initialization is not supported, indeed. If it works, it is by accident. Can you please share why are you trying to use it?
All the best,
Petyo
the Telerik team
This initialization is not supported, indeed. If it works, it is by accident. Can you please share why are you trying to use it?
All the best,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Kakone
Top achievements
Rank 1
answered on 23 Mar 2012, 10:20 AM
Hi,
I'm just doing some tests and I wanted to know if I can modify the dataSource of the listview after it is initialized. I thinked to have a layout with a listView and set the template and the datasource according to a choice of the user. This is not very problematic because I can do it in other way, I just wondered why it was not possible to do that.
Cordially,
Kakone.
I'm just doing some tests and I wanted to know if I can modify the dataSource of the listview after it is initialized. I thinked to have a layout with a listView and set the template and the datasource according to a choice of the user. This is not very problematic because I can do it in other way, I just wondered why it was not possible to do that.
Cordially,
Kakone.
0

Agnes
Top achievements
Rank 1
answered on 03 Apr 2012, 04:56 AM
Hi,
I had similar problem. When I tried to refresh a dataSource which is linked to a MobileListView, the dataSource seemed refreshed (ie it calls server to fetch data) but the listview was not refreshed.
var dataSource = $("#active-loan-listview").data("kendoMobileListView").dataSource;
dataSource.query({
page: 2,
pageSize: 10
});
Another question about dataSource. How do you get the current page of the dataSource?
Thanks,
Agnes
I had similar problem. When I tried to refresh a dataSource which is linked to a MobileListView, the dataSource seemed refreshed (ie it calls server to fetch data) but the listview was not refreshed.
var dataSource = $("#active-loan-listview").data("kendoMobileListView").dataSource;
dataSource.query({
page: 2,
pageSize: 10
});
Another question about dataSource. How do you get the current page of the dataSource?
Thanks,
Agnes
0
Hello Agnes,
By default when the dataSource is changed, the widget that is bound to it will automatically refresh. Probably there is a problem connected with the query method. Could you please confirm that after calling the query function the server is sending a response with data?
Regarding to your second question, you can use the page method in order to retrieve current page index.
Kind regards,
Alexander Valchev
the Telerik team
By default when the dataSource is changed, the widget that is bound to it will automatically refresh. Probably there is a problem connected with the query method. Could you please confirm that after calling the query function the server is sending a response with data?
Regarding to your second question, you can use the page method in order to retrieve current page index.
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

Michael
Top achievements
Rank 1
answered on 03 May 2012, 04:03 PM
This is an old thread but I wanted to chime in and say that I am having a similar issue... changing the datasource does not cause the listview to refresh.
It's not even attempting to query the server, even if you manually call refresh().
No errors thrown, simply doesn't work.
It's not even attempting to query the server, even if you manually call refresh().
No errors thrown, simply doesn't work.