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

UI of pager is not updated correctly when there are changes on the items-array using myObservableArray.setItem(...,...) #30

Closed
felixkrautschuk opened this issue Jul 27, 2017 · 2 comments

Comments

@felixkrautschuk
Copy link

Hello,
at first, thank you for creating this plugin, it will help us a lot for our project.

After playing around with the plugin for a while, I have some trouble when initializing the pager.
I try to dynamically fill the pager with content that is getting loaded from the server, but the content gets visible only when navigating to another page and back.

Here is what I am doing:

<pager:Pager id="pager" items="{{ items }}">
    <pager:Pager.itemTemplate>
        <ScrollView>
            <GridLayout rows="auto,auto,*" columns="*" backgroundColor="#DBE8C1">
                <Label row="0" text="{{ title }}"/>
                <Label row="1" text="{{ text }}"/>
            </GridLayout>
        </ScrollView>
    </pager:Pager.itemTemplate>
</pager:Pager>
exports.vmMain = observableModule.fromObject({
    selectedIndex: 0,
    items: new observableArrayModule.ObservableArray(),

    loadStoryChapters: function () {
        var self = this;

        ffHttpModule.startHttpRequest(
            ...
            //success callback
            function(response) {
               self.set("items", new observableArrayModule.ObservableArray(response.listItems));
               
               //does not work correctly, title and text are visible after navigating to another page and back
               self.get('items').setItem(
                   0, 
                   { id: "..." title: "First item", text: "This is the text of the first item..." }
               );
            }
        );
    }
});

When using this code for a ListView, the data is shown as expected, so the source of this problem really seems to be somewhere in the pager implementation.
I hope this can be fixed.

@triniwiz
Copy link
Owner

triniwiz commented Jan 6, 2018

Fixed in v7

@triniwiz triniwiz closed this as completed Jan 6, 2018
@tahir-jamil
Copy link

tahir-jamil commented May 6, 2019

pager not updating the page after response
i have a activity indicator which will run on ngOninit and when i get the response i just remove the activityIndicator with ngIf but the pager not updating the page

This issue was closed.
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

3 participants