You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
987 B
47 lines
987 B
var ItemListPage = {
|
|
|
|
onPageShow: function () {
|
|
|
|
ItemListPage.reload();
|
|
},
|
|
|
|
reload: function () {
|
|
|
|
var userId = Dashboard.getCurrentUserId();
|
|
|
|
var parentId = getParameterByName('parentId');
|
|
|
|
var query = {};
|
|
|
|
if (parentId) {
|
|
query.parentId = parentId;
|
|
|
|
ApiClient.getItem(userId, parentId).done(ItemListPage.renderTitle);
|
|
}
|
|
|
|
ApiClient.getItems(userId, query).done(ItemListPage.renderItems);
|
|
},
|
|
|
|
renderItems: function(result) {
|
|
|
|
var items = result.Items;
|
|
|
|
var renderOptions = {
|
|
|
|
items: items
|
|
};
|
|
|
|
var html = Dashboard.getPosterViewHtml(renderOptions);
|
|
|
|
$('#listItems', $.mobile.activePage).html(html);
|
|
},
|
|
|
|
renderTitle: function (item) {
|
|
|
|
|
|
$('#itemName', $.mobile.activePage).html(item.Name);
|
|
}
|
|
};
|
|
|
|
$(document).on('pageshow', "#itemListPage", ItemListPage.onPageShow);
|