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

Visualize doesn't get bookmarks at first rendering #7

Open
joni2back opened this issue Dec 18, 2019 · 0 comments
Open

Visualize doesn't get bookmarks at first rendering #7

joni2back opened this issue Dec 18, 2019 · 0 comments

Comments

@joni2back
Copy link

Hi. With some reports that has bookmarks,
when the report is loaded, visualizejs executes bookmarksReady callback, but sometimes not.
The only way to get the bookmarks event call is changing to the next page.

This is our piece of code

return new Promise(function(resolve, reject) {
    self.resetProps();

    var resource = self.lastDrillDown ? self.lastDrillDown.resource : self.resourceType;
    visualize({}, function(v) {
        self.report = v.report({
            resource: resource,
            params: self.authParams,
            container: "#".concat(self.elementRef),
            scale: self.scale,
            autoresize: true,
            runImmediately: false,
            loadingOverlay: true,
            events: {
                bookmarksReady: function(bookmarks) {
                    /*this is not called always when you render the 
                      report for the first time, sometimes you need 
                      to change to the next page to force the 
                      execution of bookmarksReady callback */
                    return self.bookmarks = bookmarks;
                },
                changeTotalPages: function(pages) {
                    return self.pagination.totalPages = pages;
                },
                reportCompleted: function() {
                    self.rendered = true;
                    self.loading = false;
                }
            },
            linkOptions: {
                events: {
                    click: function(event, link) {
                    }
                }
            }
        });
        return resolve(self.report);
    });
});
@joni2back joni2back changed the title Visualize doesn't get bookmarks Visualize doesn't get bookmarks at first rendering Dec 18, 2019
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

1 participant