0
votes

I'm using the TKListViewHeaderDirective of teleriks RadListView in nativescript like so:

<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>

it seems like two things go wrong here:

  1. this seems to be missing here (the *ngIf should show one of the StackLayouts in specific cases but does not
  2. The GridLayout (does not have any effect if I change it to StackLayout) inside the list header shows only one child element

According to the docs: http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/header-footer

1

1 Answers