tkListViewHeader 中的 nativescript 'this' (RadListView header 指令)



我正在使用so:

中的nativescript中的teleriks radlistview的tklistviewheaderdirective
<GridLayout columns="*" rows="*" tkToggleNavButton>
    <RadListView *ngIf="!loading" row="3" col="0" [items]="nodes" ...>
        <ng-template tkListItemTemplate let-node="item">
            <!-- list item -->
        </ng-template>
        <ng-template tkListViewHeader>
            <GridLayout columns="*" rows="auto, auto, auto">
                <GridLayout row="0" col="0" columns="40,*,40">
                    <Button class="fa action-item" row="0" col="0" [text]="'fa-sort-amount-asc' | fonticon" ios.position="right" android="actionBar" style="background-color:#c9c9ce;;"></Button>
                    <SearchBar row="0" col="1" #searchInput hint="Search" (submit)="search(searchInput.text)" (clear)="search('')" (textChange)="search(searchInput.text)"></SearchBar>
                    <Button class="fa action-item" row="0" col="2" [text]="'fa-th' | fonticon" ios.position="right" android="actionBar" style="background-color:#c9c9ce;"></Button>
                </GridLayout>
                <StackLayout row="1" col="0">
                    <Label text="Hello world"></Label>
                    <Label [text]="currentNode.name"></Label>
                    <Label [text]="nodes?.length ? nodes.length : 0"></Label>
                </StackLayout>
                <StackLayout row="2" col="0" *ngIf="!nodes?.length" class="list-group">
                    <!-- some contents -->
                </StackLayout>
                <StackLayout row="3" col="0" *ngIf="currentNode?.name !== '/'" class="list-group">
                    <!-- some contents -->
                </StackLayout>
            </GridLayout>
        </ng-template>
    </RadListView>
</GridLayout>

似乎有两件事出了问题:

  1. this似乎在这里缺少( *ngif应该在特定情况下显示一个堆叠式,但不显示
  2. gridlayout(如果我将其更改为stacklayout,则没有任何效果(在列表标题中仅显示一个子元素

根据文档:http://docs.telerik.com/devtools/nativecript-ui/controls/angular/listview/header-footer

github上存在一个问题:

最新更新