PeterStaev / NativeScript-Grid-View

A NatvieScript GridView widget.
Apache License 2.0
49 stars 28 forks source link

PullToRefresh? #49

Closed razorsyntax closed 5 years ago

razorsyntax commented 5 years ago

Is it possible to create a Pull to Refresh with this plugin

I've experimented with the PullToRefresh plugin to implement this to no avail. See my example, not working code below.

<PullToRefresh (refresh)="pullToRefresh($event)">
    <ListView class="list-group">
        <GridLayout>
            <GridView [items]="someItems" (itemTap)="loadThisPage($event)">
                <ng-template let-some="item">
                    <StackLayout minHeight="100">
                        <Label [text]="some"></Label>
                    </StackLayout>
                </ng-template>
            </GridView>
        </GridLayout>
    </ListView>
</PullToRefresh>

Any ideas?

razorsyntax commented 5 years ago

Update: Sadly, I ended up uninstalling GridView and implemented a custom version. I'll definitely check back to see if this is something that's possible with GridView in the future.

PeterStaev commented 5 years ago

Hey @razorsyntax , using Pull To Refresh is possible with the plugin but you are doing it wrong. You wrapped your listview with the PullToRefresh and not the GridView.

razorsyntax commented 5 years ago

@PeterStaev , Oh sweet! But how does the order go?

<Gridview>
    <PullToRefresh>
        <other-stuff></other-stuff>
    </PullToRefresh>
</Gridview>

I don't think I understood the order you mentioned.

PeterStaev commented 5 years ago

@razorsyntax ,you need to wrap the GridView just like you do with the ListView.

<PullToRefresh>
    <Gridview>
        <other-stuff></other-stuff>
    </Gridview>
</PullToRefresh>