FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add required interface for generalized listview comonent by PeterStaev · Pull Request #5524 · NativeScript/NativeScript · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions tns-core-modules/ui/list-view/list-view-common.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListView as ListViewDefinition, ItemsSource, ItemEventData } from ".";
import { ListView as ListViewDefinition, ItemsSource, ItemEventData, TemplatedItemsView } from ".";
import { CoercibleProperty, CssProperty, Style, View, Template, KeyedTemplate, Length, Property, Color, Observable, EventData, CSSType } from "../core/view";
import { parse, parseMultipleTemplates } from "../builder";
import { Label } from "../label";
Expand All @@ -19,7 +19,7 @@ export module knownMultiTemplates {
const autoEffectiveRowHeight = -1;

@CSSType("ListView")
export abstract class ListViewBase extends View implements ListViewDefinition {
export abstract class ListViewBase extends View implements ListViewDefinition, TemplatedItemsView {
public static itemLoadingEvent = "itemLoading";
public static itemTapEvent = "itemTap";
public static loadMoreItemsEvent = "loadMoreItems";
Expand Down
9 changes: 9 additions & 0 deletions tns-core-modules/ui/list-view/list-view.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ export interface ItemsSource {
getItem(index: number): any;
}

export interface TemplatedItemsView {
items: any[] | ItemsSource;
itemTemplate: string | Template;
itemTemplates?: string | Array<KeyedTemplate>;
refresh(): void;
on(event: "itemLoading", callback: (args: ItemEventData) => void, thisArg?: any);
off(event: "itemLoading", callback: (args: EventData) => void, thisArg?: any);
}

/**
* Represents the property backing the items property of each ListView instance.
*/
Expand Down

Back | FazBrowse Home | New Git URL