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

Nesting? #142

Open
kryptus36 opened this issue Oct 1, 2019 · 11 comments
Open

Nesting? #142

kryptus36 opened this issue Oct 1, 2019 · 11 comments

Comments

@kryptus36
Copy link

I'd like to have the top portion of my app swipeable to change the page and another inner pager for some contextual data. However, when I swipe the inner pager, it affects the outer one instead.

Is this use case supported?

@triniwiz
Copy link
Owner

triniwiz commented Oct 1, 2019

Ah nice use case which platform(s)

@kryptus36
Copy link
Author

I'm currently testing on an Android emulator. I'd like to support ios as well, but I'm currently developing on a Linux machine.

tns version is 6.0.0-2019-07-15-150533-13643

@triniwiz
Copy link
Owner

triniwiz commented Oct 1, 2019

Can you try something for me in the loaded event callargs.object.android.setNestedScrollingEnabled(true) and LMK what happens 😄

@kryptus36
Copy link
Author

It didn't seem to have any affect. I'm assuming you meant the loaded event for the page.

@triniwiz
Copy link
Owner

triniwiz commented Oct 1, 2019

No for the pager

@kryptus36
Copy link
Author

Still seems to have no effect (I tried it on both inner and outer). Am I doing something wrong?

@triniwiz
Copy link
Owner

triniwiz commented Oct 1, 2019

Can you paste some of the view code

@triniwiz
Copy link
Owner

triniwiz commented Oct 2, 2019

Btw I meant something like

<Pager (loaded)="loaded($event)">
....
<GridLayout rows="*,*>
<Pager>
......
<Pager row="1">
....</GridLayout>
loaded(args){
args.object.android.setNestedScrollingEnabled(true);
}

@kryptus36
Copy link
Author

As I was writing this I noticed in my UI the inner pager actually does give me the white "you can't drag any further" markers if I drag vertically. Interesting. It doesn't actually show me anything other than the first one though (and I did manually verify there's more than one element in the array).

Here's the outer:

<StackLayout xmlns:pager="nativescript-pager" xmlns:components="components">
  <pager:Pager height="100%" width="100%" selectedIndex="1"
  items="{{clientVenues}}" id="venue-pager" loaded='pagerLoaded'
  showNativePageIndicator="false" backgroundColor="lightsteelblue">
    <pager:Pager.itemTemplate>
      <StackLayout>
        <Label text="{{name}}" class="venue-name" />
        <StackLayout class="hr-light m-t-5 m-b-5" colSpan="2"></StackLayout>
        <Label text="{{pots.date | humanDate}}" class='date' />
          <components:pot-pager />
      </StackLayout>
    </pager:Pager.itemTemplate>
  </pager:Pager>
</StackLayout>

And inner:

<StackLayout xmlns:pager="nativescript-pager" xmlns:lv="nativescript-ui-listview" >
  <pager:Pager height="100%" width="100%" loaded='pagerLoaded'
  items="{{pots.events}}" id="pot-pager"
  showNativePageIndicator="false" backgroundColor="green">
    <pager:Pager.itemTemplate>
      <StackLayout>
        <Label text="{{name}}" class="event-name" />
        <lv:RadListView row="0" items="{{ pots }}"> 
            <lv:RadListView.listViewLayout>
                <lv:ListViewLinearLayout />
            </lv:RadListView.listViewLayout>
            <lv:RadListView.itemTemplate>
                <StackLayout>
                    <GridLayout rows="*" columns="*,100,100">
                      <Label col="0" text="{{name}}" />
                      <Label col="1" text="{{numbers ? numbers + '#s' : null}}" />
                      <Label col="2" text="{{prize | formatPrize}}" />
                    </GridLayout>
                </StackLayout>
            </lv:RadListView.itemTemplate>
        </lv:RadListView>
      </StackLayout>
    </pager:Pager.itemTemplate>
  </pager:Pager>
</StackLayout>
exports.pagerLoaded = function(args) {
  console.log("Pager loaded", args);
  args.object.android.setNestedScrollingEnabled(true);
}

@kryptus36
Copy link
Author

Is there any obvious reason why my inner pager won't page to the next element (and why its trying to page vertically)?

@triniwiz
Copy link
Owner

triniwiz commented Oct 3, 2019

I can try adding this feature to the demo an I'll know from there

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

2 participants