Radsplitter: javascript when one of the pane is collapsed and content is rendered through url

4 posts, 0 answers
  1. Rocky
    Rocky avatar
    6 posts
    Member since:
    Dec 2008

    Posted 27 Jan 2009 Link to this post

    I have a splitter with two panes: left and right. I set the contentURL for both the panes using a Javascript. When one of the Pane is collapsed, I get a javascript error "invalid arguments"  when my reports are rendering.

    <telerik:RadSplitter id="RadSplitter1" runat="server" width="100%" height="800"  Orientation="Vertical" >
                       
                <telerik:RadPane id="LeftPanel" runat="server"> </telerik:RadPane>
                              
                <telerik:RadSplitBar id="RadSplitBar1" runat="server"  collapsemode="Both"></telerik:RadSplitBar>
                               
                <telerik:RadPane id="RightPanel" runat="server"></telerik:RadPane>
                               
    </telerik:RadSplitter>

    function renderReport(url1,url2) {
                var splitter = $find("<%= RadSplitter1.ClientID %>");
                var vLeftPanel = splitter.getPaneById("LeftPanel");
                var vRightPanel = splitter.getPaneById("RightPanel");
               
                vLeftPanel.set_contentUrl(url1);
                vRightPanel.set_contentUrl(url2);
    }

    when I debug, I see that the error is thrown at Rad build-in function, pps_tree_updateLabel: function()

     

     


    at the below line:
    this.ppstreeLabelTextElement.style.width = this.ppstreeLabelTextElement.parentElement.offsetWidth - this.ppstreeDropDownImage.currentStyle.width.replace("px", "");

    Below is the complete function:

    pps_tree_updateLabel: function()
     {
      var s = "";
         var collection = this.ppstreeTreeElement.getElementsByTagName("input");
         for (var i=0; i < collection.length; ++i)
         {
             var el = collection[i];
             if ((el.checked == true) && (el.className != "pps-tree-selector"))
             {
        var eparent = el.parentElement;
        s = s + eparent.innerText + this.ppstreeSeparatorCharacter + " ";
             }
         }
         this.ppstreeLabelTextElement.style.width = 0;
      this.ppstreeLabelTextElement.innerText = s.substring(0,s.length-2);
      this.ppstreeLabelTextElement.title = this.ppstreeLabelTextElement.innerText;
      if (this.ppstreeLabelTextElement.scrollWidth > this.ppstreeLabelTextElement.parentElement.offsetWidth - this.ppstreeDropDownImage.currentStyle.width.replace("px", ""))
      {
       this.ppstreeLabelTextElement.style.width = this.ppstreeLabelTextElement.parentElement.offsetWidth - this.ppstreeDropDownImage.currentStyle.width.replace("px", "");
      }
      else
      {
       this.ppstreeLabelTextElement.style.width = this.ppstreeLabelTextElement.scrollWidth;
      }
     },

     

     

     

     

    The problem is only when one of the pane is collapsed.

    Can someone please help me to get rid of this errro?

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 30 Jan 2009 Link to this post

    Hi Rocky,

    I am afraid that the provided information is not enough to reproduce the problem on my side. I prepared a sample demo based on the provided code and tested executing the renderReport function when both the RadPanes are expanded and also when one of them is collapsed but I was not able to observe the problem.

    Please, modify the attached demo in order to replicate the problem, open a new support ticket and send it to me along with detailed and clear reproduction steps and explanations of the actual and the desired behavior. Once I am able to analyze the setup locally, I will do my best to help.

    Sincerely yours,
    Svetlina
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rocky
    Rocky avatar
    6 posts
    Member since:
    Dec 2008

    Posted 30 Jan 2009 Link to this post

    Some of the urls like the one you are using do not have any problems. The url that I am using is a PPS report that is integrated in sharepoint. The report takes about 1 minute to load and is ajax based loading. I am not sure how can I provide such report. If you have a PPS report on your environment, please use it and you must be able to see the problem.
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 02 Feb 2009 Link to this post

    Hi Rocky,

    We checked all of the source of RadControls for ASP.NET AJAX but there is no  pps_tree_updateLabel: function() function there. Since this code is not ours we cannot tell what is th exact problem.

    Based on the provided information we assume that the problem is on the following line:

    this.ppstreeLabelTextElement.style.width = this.ppstreeLabelTextElement.parentElement.offsetWidth - this.ppstreeDropDownImage.currentStyle.width.replace("px", "");

    because it for some reason returns a negative value which is not a valid argument for width.

    In order to confirm this we suggest to do the following test:

    1. Remove the RadSplitter and instead of RadPane use a standard IFRAME element.
    2. Put a button on the page and on its click, set the IFRAME's width to 0 - this simulates the collapse of the RadPane.
    3. If this setup reproduces the problem, you should either change the logic in the mentioned function or find a workaround for this standard setup. When you have workarounded it, just apply the same fix for the RadPane. 

    All the best,
    Svetlina
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top