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

Modal windows: return value from content loaded with ajax

3 Answers 379 Views
Window
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 15 Feb 2012, 08:18 PM
Hi

How is the correct way to get some return value from a modal window that contains "external" HTML loaded with the "content:" property?

in page1.html I create my window:

<div id="kw" />
    var kendoWindow = $("#kw").kendoWindow({
    content: "Page2.html",
    close: function (e) { alert('closed'); }
        });


page2.html is sometyhing like this:

<input id="number" value="123" />
<buton id="ok">OK</button>

After the window is closed, how can I access the value of #number ?

Thank you

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 16 Feb 2012, 01:32 PM
Unless you are destroying the window contents upon the window closing, you can simply access the data through jQuery, like so:

var value = $("#number").val();

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Raymond
Top achievements
Rank 1
answered on 01 Mar 2013, 03:18 PM
I have similar requirement but cannot get the value back. 

In my case I load the content via MVC view which contains 2 input box. On clicking the close button in the kendo window, the alert being placed in the close event said "undefined".

Please advise how to resolve this.
0
Alex Gyoshev
Telerik team
answered on 04 Mar 2013, 01:31 PM
Hello Raymond,

Does jQuery find the input boxes? If yes, please open a new thread and submit a sample that shows the problem.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Window
Asked by
Pedro
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Raymond
Top achievements
Rank 1
Share this question
or