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

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

3 Answers 118 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Rocky
Top achievements
Rank 1
Rocky asked on 27 Jan 2009, 11:52 PM
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?

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 30 Jan 2009, 02:15 PM
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.
0
Rocky
Top achievements
Rank 1
answered on 30 Jan 2009, 05:12 PM
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.
0
Svetlina Anati
Telerik team
answered on 02 Feb 2009, 05:05 PM
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.
Tags
Splitter
Asked by
Rocky
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Rocky
Top achievements
Rank 1
Share this question
or