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

RadWindow clientCallback

4 Answers 130 Views
Window
This is a migrated thread and some comments may be shown as answers.
Shed Dweller
Top achievements
Rank 1
Shed Dweller asked on 28 Jul 2008, 08:55 PM
The documentation is a bit light on how to use clientCallback().

What do you do in the opened window in order to return data.

I used to do this alot with window.showModalDialog().  You can return all kinds of objects e.g. even 2D arrays with it. I may have to resort to using it since I know my target browser isIE.

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Jul 2008, 06:21 AM
Hello Sean,

I believe that the Using RadWindow as a Dialog topic in the documentation will be of help. It shows how to send arguments to the parent page depending on whether you will read it in the ClientCallbackFunction or in OnClientClose.



Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shed Dweller
Top achievements
Rank 1
answered on 30 Jul 2008, 08:46 AM
Thanks

However it seems I can only return text to the calling window so I probably will resort to window.showModalDialog() since I need to to return an array of values.

Sean
0
Tervel
Telerik team
answered on 30 Jul 2008, 08:49 AM
Hi Sean,

In fact you can return any javascript object (regardless of whether it is a string or array or something else).

Kind regards,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stuart Hemming
Top achievements
Rank 2
answered on 30 Jul 2008, 10:05 AM
Sean,

You'll find that you can return any JS object as the result.

Here's a bit of code I've just pulled out of one of my apps that is called, in my case from a grid dbl-click where the grid is displayed in the radWindow ...
var oWindow = GetRadWindow(); 
var arg = new Object(); 
arg.popupType = document.getElementById("__PopupType").value; 
if (arg.popupType == "picklist") { 
  var mainColumnName = document.getElementById("__MainColumn").value; 
  if (mainColumnName != "") arg.mainColumnValue = masterTable.getCellByColumnUniqueName(row, mainColumnName).innerHTML
  var displayColumns = document.getElementById("__DisplayColumns").value; 
  if(displayColumns != "") { 
    var displayColumnsArray = displayColumns.split(","); 
    var displayColumnsValue = ""
    for(var i=0; i<displayColumnsArray.length; i++) { 
      if (displayColumnsValue != "") displayColumnsValue += ","
      displayColumnsValue += masterTable.getCellByColumnUniqueName(row, displayColumnsArray[i]).innerHTML
    } 
  } 
  arg.displayColumnsValue = displayColumnsValue; 
arg.dbfr = dbfr; 
oWindow.Close(arg); 

Hope this helps.

--
Stuart


Tags
Window
Asked by
Shed Dweller
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Shed Dweller
Top achievements
Rank 1
Tervel
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or