Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use ListView within the pager? nested ng-templates? #44

Closed
MuhammadTahir92 opened this issue Feb 15, 2018 · 11 comments
Closed

Can we use ListView within the pager? nested ng-templates? #44

MuhammadTahir92 opened this issue Feb 15, 2018 · 11 comments

Comments

@MuhammadTahir92
Copy link

MuhammadTahir92 commented Feb 15, 2018

<Pager row="1" [items]="items | async" #pager selectedIndex="5" (selectedIndexChange)="onIndexChanged($event)" class="pager"
    backgroundColor="lightsteelblue">
    <ng-template let-i="index" let-item="item">
        <GridLayout class="pager-item" rows="auto, *" columns="*" backgroundColor="red">
            <ListView class="list-group" [items]="countries">
                <ng-template let-country="item">
                    <RL:Ripple rippleColor="#e6e6e6" (tap)="dealDetails()">
                        <GridLayout rows="*" columns="*" class="padding">
                            <StackLayout orientation="vertical">
                                <Label class=" h6" style="font-size:13;" [text]='country.name'></Label>
                            </StackLayout>
                        </GridLayout>
                    </RL:Ripple>
                </ng-template>
            </ListView>
        </GridLayout>
    </ng-template>
</Pager>
@MuhammadTahir92
Copy link
Author

any update on it?

@triniwiz
Copy link
Owner

The core version works fine i need to do more testing on the angular side

@MuhammadTahir92
Copy link
Author

ok

@alexandruantonica
Copy link

@triniwiz ListView works fine inside of Pager with angular. I use something like that in my apps.
@MuhammadTahir92 I guess your problem is with Ripple plugin.
You use <RL:Ripple> instead of registering Ripple and use it like that <Ripple>.

@MuhammadTahir92
Copy link
Author

@alexandruantonica i test it but its not working result is the same as before ?

can you share your code sample in which you are using angular listview with pager

@alexandruantonica
Copy link

Hi @MuhammadTahir92
Sure.
Below you have a sample of my code.

<Pager [items]="groupedProperties"
                       #pager
                       dock="top"
                       [selectedIndex]="currentPagerIndex"
                       (selectedIndexChanged)="onIndexChanged($event)">

                    <ng-template pagerItemTemplate let-i="index" let-properties="item">
                        <StackLayout>
                            <!-- profiles -->
                            <StackLayout [style.width]="card.width" [class]="card.classes[i]">
                                <DockLayout stretchLastChild="true" class="container" height="100%">
                                    ....
                                    <!-- content -->
                                    <DockLayout dock="bottom" class="card-container">
                                        <!-- info -->
                                        <ListView [items]="properties" class="list-group">
                                            <ng-template let-property="item">
                                                <StackLayout>
                                                    <Fields [item]="property" (tap)="onTap(property)"></Fields>
                                                </StackLayout>
                                            </ng-template>
                                        </ListView>
                                    </DockLayout>
                                </DockLayout>
                            </StackLayout>
                    </ng-template>
                </Pager>

If still doesn't work for you, please make an example in Playground and share with us. I guess it will be very useful for @triniwiz .

@MuhammadTahir92
Copy link
Author

ok i will

@zeesulehria
Copy link

well i also got same issue hear
and this is my play ground link
https://play.nativescript.org/?template=play-ng&id=c79l7G

@zeesulehria
Copy link

its not showing any list item

@zeesulehria
Copy link

Found the issue. You have to use ListView in a component. Directly using ListView in Pager doesn't work.

@racknoris
Copy link

@zeesulehria What do you mean? A custom component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants