TNS v2.5.0
I've imported LISTVIEW_DIRECTIVES
into my app.module and my template looks like
<ActionBar title="Events"></ActionBar>
<StackLayout orientation="vertical">
<RadListView [items]="events">
<template tkListItemTemplate let-event="item">
<StackLayout orientation="vertical">
<Image [src]="'https:' + event.image" stretch="aspectFit"></Image>
<Label [nsRouterLink]="['/event', event.id]" [text]="event.title"></Label>
</StackLayout>
</template>
</RadListView>
</StackLayout>
but this displays nothing but changing to a regular ListView
works fine.
Also If I try a GridLayout
like
<ActionBar title="Events"></ActionBar>
<GridLayout>
<RadListView [items]="events">
<template tkListItemTemplate let-event="item">
<StackLayout orientation="vertical">
<Image [src]="'https:' + event.image" stretch="aspectFit"></Image>
<Label [nsRouterLink]="['/event', event.id]" [text]="event.title"></Label>
</StackLayout>
</template>
</RadListView>
</GridLayout>
the app crashes with an error of
file:///app/tns_modules/nativescript-telerik-ui/listview/listview.js:1034:104: JS ERROR TypeError: undefined is not an object (evaluating 'itemViewDimensions.measuredWidth') Feb 5 11:40:53 Marcuss-iMac com.apple.CoreSimulator.SimDevice.1A8C1E25-DAC0-4BA0-822E-5A6F731F1CD7.launchd_sim[31919] (UIKitApplication:org.nativescript.t4g[0x7b2a][36194]): Service exited due to Segmentation fault: 11
Not sure if I've missed importing something somewhere but the documentation it's pretty sketchy so hard to be sure and looking at the examples
<ActionBar title="Events"></ActionBar> <GridLayout> <ListView [items]="events | async"> <template let-item="item"> <StackLayout orientation="vertical"> <Image [src]="'https:' + item.image" height="200"></Image> <Label class="nameLabel" [text]="item.title"></Label> </StackLayout> </template> </ListView> </GridLayout>
– Commercialize<ActionBar title="Events"></ActionBar> <GridLayout tkExampleTitle tkToggleNavButton> <RadListView [items]="events | async"> <template tkListItemTemplate let-item="item"> <StackLayout orientation="vertical"> <Image [src]="'https:' + item.image" height="200"></Image> <Label class="nameLabel" [text]="item.title"></Label> </StackLayout> </template> </RadListView> </GridLayout>
– Commercializefile:///app/tns_modules/nativescript-telerik-ui/listview/listview.js:1034:104: JS ERROR TypeError: undefined is not an object (evaluating 'itemViewDimensions.measuredWidth')
– Commercialize