This is a migrated thread and some comments may be shown as answers.

Edit RadPageView css on client side using javascript

2 Answers 75 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Vitalii
Top achievements
Rank 1
Vitalii asked on 10 Jan 2013, 03:35 PM
I have multi page with page vies:

 <telerik:RadMultiPage runat="server" ID="multipage" SelectedIndex="0">
    <telerik:RadPageView runat="server" ID="PageViewQS" CssClass="tab"> </telerik:RadPageView>
    <telerik:RadPageView runat="server" ID="PageViewCS" CssClass="tab"> </telerik:RadPageView>
 </telerik:RadMultiPage>

Css class:
.tab {
    padding: 10px;
    overflow: auto;
    height: 650px;
}

I want to change css height on client side using javascript. I tried this:
               $(document).ready(function () {
                    if (screen.height > 800) {
                        $('#multipage').css('height', '475px');
                        $('#PageViewQS').css('height', '475px');
                    }
                });

but id does not work.

Any ideas how can I do it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nencho
Telerik team
answered on 15 Jan 2013, 01:18 PM
Hello Vitali,

I can suggest you to access the DOM element of the RadPageView and set the height in the following manner :
<script type="text/javascript">
           function pageLoad() {
 
              var $ = $telerik.$;
              var height = $(window).height();
              if (height > 800) {
 
                  var MultiPage = $find('<%= multipage.ClientID %>');
                  for (i = 0; i < MultiPage.get_pageViews().get_count() ; i++) {
                      var PageView = MultiPage.get_pageViews().getPageView(i);
                      PageView.get_element().style.height = "475px";
                  }
              }
          }
 
      </script>


Kind regards,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Vitalii
Top achievements
Rank 1
answered on 25 Jan 2013, 10:52 AM
Thank you for your answer, I will try)
Tags
TabStrip
Asked by
Vitalii
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Vitalii
Top achievements
Rank 1
Share this question
or