How to move scroll to pages?

Stimulsoft Reports.WEB discussion
Post Reply
a.ebbini
Posts: 101
Joined: Thu Jun 05, 2014 8:10 am
Location: Jordan

How to move scroll to pages?

Post by a.ebbini »

Dear Support Team,
i have button its function to move scroll to specific page. i see page source there is a tables that contain page with class assign to stiWebViewerPageShadow style. i try to get pages top position throw jquery below

Code: Select all

   
            var TableID = '';
            var TableTopPosition = '';
            var Tables = jQuery(".stiWebViewerPageShadow");
            for (var i = 0; i < Tables.length; i++) {
                TableID = 'table[class="stiWebViewerPageShadow"]' + ':eq(' + i + ')'
                TableTopPosition = TableTopPosition + ',' + jQuery(TableID).position().top
            }
but the problem Tables variable dosen't retrive those tables.

My question can you catch with me what is problem, or if you have any alternative way to make this job.
a.ebbini
Posts: 101
Joined: Thu Jun 05, 2014 8:10 am
Location: Jordan

Re: How to move scroll to pages?

Post by a.ebbini »

Dear Support Team,
I find a way to get pages position throw this jQuery script below :

Code: Select all

            var TableTopPosition = [];
            var Tables = jQuery("#webReportTableFrame_ctl00_bodyContentPlaceHolder_StiCallbackPanel_RV").contents().find('iframe').contents().find('.stiWebViewerPageShadow');
            for (var i = 0; i < Tables.length; i++) {
                TableTopPosition.push(jQuery(Tables[i]).position().top)
            }
jQuery('html, body').animate({ scrollTop: TableTopPosition[PageNumber] }, duration);
Now i want to know if you recommend this way of getting pages position, and if not i need another way this urgent.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: How to move scroll to pages?

Post by Vladimir »

Hello,

The ID of the viewer component should not change, so your code should work correctly.

Thank you.
a.ebbini
Posts: 101
Joined: Thu Jun 05, 2014 8:10 am
Location: Jordan

Re: How to move scroll to pages?

Post by a.ebbini »

I am put StiWebViewer in callback panel and the callback panel in ContentPlaceHolde and all of these controls i will never change its id names. and as you said if all these never change this code line :

Code: Select all

var Tables = jQuery("#webReportTableFrame_ctl00_bodyContentPlaceHolder_StiCallbackPanel_RV").contents().find('iframe').contents().find('.stiWebViewerPageShadow');
will be correct always it is true.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: How to move scroll to pages?

Post by Vladimir »

Hello,

Yes, these IDs are statically defined, dynamically and programmatically should not change.

Thank you.
Post Reply