Hello,
I have a list view that can display, depending on the user behavior, different sets of results. One simply has to click on a button to trigger a JS event that will retrieve the appropriated data.
Basically, I have a very simple listview in my homepage.html:
on which I attache a listview with jQuery:
And when a user needs other results, I repeat this process again. For instance:
And I can see the results I want to be display in the listview. But I've noticed 2 things:
1 - If the previous list was longer than the new one, the user can get "stuck" at the bottom of the list where no results are displayed. I would like to have the listview to automatically scroll to the top.
2 - I have the feeling I'm adding a list view in within the list view when looking at my html in the code inspector, after clicking to different buttons with the same puropose (only the content is different, as well as the structure of the results received from my servers) I have the list view appended inside the previous one:
See the screenshot.
Can you help me fixing those 2 issues ?
Many thanks
I have a list view that can display, depending on the user behavior, different sets of results. One simply has to click on a button to trigger a JS event that will retrieve the appropriated data.
Basically, I have a very simple listview in my homepage.html:
<
div
id
=
"mainContainer"
>
<
ul
id
=
"list-container"
>
</
ul
>
</
div
>
on which I attache a listview with jQuery:
$.when( Event.getEventsNearby( position.coords.latitude, position.coords.longitude, radius, limit, offset, key ) ).done(
function
( response )
{
var
template = Handlebars.compile( $(
'#eventListTemplate'
).html() );
$(
"#list-container"
).kendoMobileListView({
template : template,
dataSource: kendo.data.DataSource.create(results)
});
} );
And when a user needs other results, I repeat this process again. For instance:
$.when( User.getUsersNearby( position.coords.latitude, position.coords.longitude, Usr_radius, Usr_limit, Usr_offset ) ).done(
function
( response )
{
var
template = Handlebars.compile( $(
'#userListTemplate'
).html() );
$(
"#list-container"
).kendoMobileListView({
template : template,
dataSource: kendo.data.DataSource.create( results )
});
});
And I can see the results I want to be display in the listview. But I've noticed 2 things:
1 - If the previous list was longer than the new one, the user can get "stuck" at the bottom of the list where no results are displayed. I would like to have the listview to automatically scroll to the top.
2 - I have the feeling I'm adding a list view in within the list view when looking at my html in the code inspector, after clicking to different buttons with the same puropose (only the content is different, as well as the structure of the results received from my servers) I have the list view appended inside the previous one:
See the screenshot.
Can you help me fixing those 2 issues ?
Many thanks