Pages

Showing posts with label Telerik Rad Controls. Show all posts
Showing posts with label Telerik Rad Controls. Show all posts

Feb 20, 2013

How to pass argument from Rad popup window to parent window

Below is an example that demonstrates how to pass an argument from the rad pop window to parent window and based on the argument we should refresh the page.

On the pop up window call the pageload method like

<body onload="pageload();">

and call the close popup method from button click.

then use the script as below
var oWnd;
        function closePopup(URL) {

            oWnd.argument = "Refresh"; // Set the updated value in button click
            oWnd.close();
                }
       
        function pageLoad() {
            oWnd = GetRadWindow();
        }
                

        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }  


On the parent window onclientclose method get the argument and based on the argument i am reloading the page.

          function OnClientClose(oWnd) {
              var arg = oWnd.argument;
              
            oWnd.setUrl("about:blank"); // Sets url to blank
              oWnd.remove_close(OnClientClose);
              if(arg.toString() == 'Refresh')
                window.location.reload();
               //remove the close handler - it will be set again on the next opening
          }

Jun 26, 2010

How to find expandedPaneId of Rad Sliding Pane and collapse + Client side

While using more sliding panes in my project , there was a need to expand and collapse panes manually and programatically. 


When doing so, i noticed a problem with Sliding Pane that when we try to expand a pane when already other pane is expanded , there was a mesh. 


Both the panes are expanded but the Close[x] button is not working in the panes.
i.e we are unable to close the pane using the Close[x] button on the pane.


so here we go how to solve this problem?
The solution is " Lets find the expanded pane id for the SlidingZone and collapse it first before opening a new pane. Below is the code.


// finds the Rad sliding zone first in which the pane resides
var slidingZone = $find("SlidingZone1");
(or)
 var slidingZone = $find("<%= SlidingZone1.ClientID %>"); // for Master Page Scenerio


// find the expanded pane id of the zone and collapse it
var expandedPaneId = slidingZone.get_expandedPaneId();


 // To collapse the pane 
      slidingZone.collapsePane(expandedPaneId );



After this, one can perform expand collapse pane operations as shown in my previous post without mesh.

Apr 19, 2010

How to Expand and Collapse a rad Sliding pane from client side while using Master Pages.

Below is the code used to Expand the Rad Sliding Pane:


       // finds the Rad sliding zone first in which the pane resides
        var slidingZone = $find("<%= SlidingZone1.ClientID %>");
       // finds the Rad sliding pane need to be expanded.
        var pane = $find("<%= SlidingPane1.ClientID %>");
       // Expands the pane
        slidingZone.expandPane(pane.get_id());


      // To collapse the pane 
      slidingZone.collapsePane(pane.get_id());