本文整理匯總了TypeScript中nativescript-ui-listview.RadListView類的典型用法代碼示例。如果您正苦於以下問題:TypeScript RadListView類的具體用法?TypeScript RadListView怎麽用?TypeScript RadListView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RadListView類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: onLoadMoreDataRequested
public onLoadMoreDataRequested(args: LoadOnDemandListViewEventData) {
const that = new WeakRef(this);
const listView: RadListView = args.object;
if (!this._itemsLoading) {
if (this._sourceDataItems.length !== 0) {
console.log("Load More Data Requested WILL LOAD");
// Set flag to make sure that items are being loaded in the correct order.
// This is necessary due to the asyc nature of getting and adding new items
// to the 'items' property of the RadListView that may be caused by remote server API lag.
this._itemsLoading = true;
setTimeout(function () {
let thatInstance = that.get();
thatInstance.addMoreItemsFromSource(1);
// Reset the flag to allow next calls of 'loadMoreDataRequested' to load more items
thatInstance._itemsLoading = false;
listView.notifyLoadOnDemandFinished();
}, 1500);
} else {
console.log("Load More Data Requested CANNOT LOAD");
args.returnValue = false;
listView.notifyLoadOnDemandFinished(true);
}
}
}
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:29,代碼來源:listview-fixed-size-auto-with-small-source.component.ts
示例2: onLoadMoreItemsRequested
public onLoadMoreItemsRequested(args: LoadOnDemandListViewEventData) {
const that = new WeakRef(this);
const listView: RadListView = args.object;
if (this._sourceDataItems.length > 0) {
setTimeout(function () {
that.get().addMoreItemsFromSource(2);
listView.notifyLoadOnDemandFinished();
}, 1500);
} else {
args.returnValue = false;
listView.notifyLoadOnDemandFinished(true);
}
}
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:13,代碼來源:listview-dynamic-size-auto.component.ts
示例3: setTimeout
setTimeout(function () {
let thatInstance = that.get();
thatInstance.addMoreItemsFromSource(1);
// Reset the flag to allow next calls of 'loadMoreDataRequested' to load more items
thatInstance._itemsLoading = false;
listView.notifyLoadOnDemandFinished();
}, 1500);
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:9,代碼來源:listview-fixed-size-auto-with-small-source.component.ts
示例4: setTimeout
setTimeout(function () {
that.get().addMoreItemsFromSource(2);
listView.notifyLoadOnDemandFinished();
}, 1500);
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:4,代碼來源:listview-dynamic-size-auto.component.ts