I have a window with a list box and on the window close I'm trying to move the data from that list into a list in the parent window.
Here is the html snippet for the window content
Any idea why the code in my onClose event isn't doing anything?
Here is the html snippet for the window content
<div id="selectcontactwindow" class="k-content"> <script type="text/javascript"> $(document).ready(function () { $("#parent").val("Select an Agency Contact"); $("#contactselect").kendoComboBox([ { text: "Contact 1", value: 1 }, { text: "Contact 2", value: 2}]); $("#add").click(function () { var obj = $("#contactselect option:selected"); if ($("#selectedcontacts option[value="+obj.val()+"]").length == 0) { $("#selectedcontacts") .append($("<option></option>") .prop("value", obj.val()) .text(obj.text())); } }); $("#remove").click(function () { $("#selectedcontacts option:selected").remove(); }); }); </script> <table> <tr> <td> <label for="parent" class="k-label">Parent</label> </td> <td> <input id="parent" disabled="disabled" type="text" class="k-textbox"/> </td> </tr> <tr> <td> <label for="contactselect" class="k-label">Select a Contact</label> </td> <td> <select id="contactselect" class="k-combobox" placeholder="Please select a contact" > </select> </td> </tr> <tr> <td> <label for="selectedcontacts" class="k-label">Selected Contacts</label> </td> <td> <select id="selectedcontacts" multiple="multiple" class="k-list-container" style="width: 100%"> <option value="11">Contact 11</option> <option value="12">Contact 12</option> </select> </td> </tr> <tr> <td></td> <td> <button id="add" class="k-button">Add</button> <button id="remove" class="k-button">Remove</button> </td> </tr> </table> </div>Here is the code for the parent window.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title></title><linkhref="../Styles/kendo.common.min.css"type="text/css"rel="stylesheet"/><linkhref="../Styles/kendo.metro.min.css"type="text/css"rel="stylesheet"/><scriptsrc="../Scripts/jquery-1.7.1.min.js"type="text/javascript"></script><scriptsrc="../Scripts/kendo.all.min.js"type="text/javascript"></script></head><body><div><scripttype="text/javascript">$(document).ready(function () {var window = $("#window");$("#openwindow").click(function () {window.data("kendoWindow").open().center();});if (!window.data("kendoWindow")) {window.kendoWindow({content: "selectcontact.htm",title: "Select a Contact",actions: ["Refresh", "Close"],visible: false,modal: true,close: onClose});}function onClose(e) {$("#selectedcontacts option").each(function() {$("#returnedcontacts").append("<option></option>").prop("value", $(this).val()).text($(this).text());});}});</script><pid="window"></p><buttonid="openwindow"class="k-button">Open Window</button><br/><selectid="returnedcontacts"multiple="multiple"></select></div></body></html>
Any idea why the code in my onClose event isn't doing anything?
