Is there a way I can return an entire window using AJAX?
I currently have this AJAX call:
$.ajax({
url: 'ajax/update_project_item2.php',
type: 'post',
data: {'select':select,'items':jsonString},
success: function(data, status) {
$('#test').append(data);
}
});
I have this PHP:
$type = $_POST['select']; // This is the select box option
$items = ($_POST['items']); // This is a Json string with the checkbox array in
switch ($type)
{
case "mode":
echo '<div id="w" class="easyui-window" title="Basic Window" data-options="iconCls:\'icon-save\'" style="width:500px;height:200px;padding:10px;">
The window content.
</div>';
break;
case "position":
break;
case "colour":
break;
default:
break;
}
Ideally I could use each part of the case statement to return a different easyUI window. The reason for this is that I want to add a load of combo boxes that would be built dynamically based on the '$items' variable. This almost seems to work, but is missing something!
Thanks!