<script>
function show_scenarioOpenDialog() {
$('#openScenarioDialog').dialog('open');
return false;
}
$(function() {
$('#openScenarioDialog').dialog({
autoOpen: false,
modal: true,
width: 600,
buttons: {
<g:if test="${!isReadOnly}">
'${message(code:"button.form.submit")}': function() {
$('#openScenarioForm').submit();
},
</g:if>
'${message(code:"button.form.cancel")}': function() {
$( this ).dialog( "close" ); // der bleibt tatsaechlich erhalten
}
}
});
$("#scenarioName").autocomplete({
source: function(request, response) {
$.ajax({
url: "${createLink(base: '.', action: 'findByNameLike', controller: 'scenario')}",
dataType: "json",
data: {
name: request.term
},
success: function(data) {
response($.map(data, function(item) {
return {
label: item.name,
value: item.name,
title: item.uid
}
}))
}
})
},
minLength: 1,
select: function(event, ui) {
$("#scenarioUid").val(ui.item.title);
}
});
});
</script>
<div id="openScenarioDialog" class="popupForm" title="Open Scenario">
<g:form target="_top" base="." action="openScenarioSubmit" controller="workspace" name="openScenarioForm">
<div class="search form-row ui-widget">
<label for="scenarioName">Scenario Name: </label>
<input type="text" id="scenarioName" name="scenarioName" />
<input type="hidden" id="scenarioUid" name="scenarioUid"/>
</div>
</g:form>
</div>
function show_scenarioOpenDialog() {
$('#openScenarioDialog').dialog('open');
return false;
}
$(function() {
$('#openScenarioDialog').dialog({
autoOpen: false,
modal: true,
width: 600,
buttons: {
<g:if test="${!isReadOnly}">
'${message(code:"button.form.submit")}': function() {
$('#openScenarioForm').submit();
},
</g:if>
'${message(code:"button.form.cancel")}': function() {
$( this ).dialog( "close" ); // der bleibt tatsaechlich erhalten
}
}
});
$("#scenarioName").autocomplete({
source: function(request, response) {
$.ajax({
url: "${createLink(base: '.', action: 'findByNameLike', controller: 'scenario')}",
dataType: "json",
data: {
name: request.term
},
success: function(data) {
response($.map(data, function(item) {
return {
label: item.name,
value: item.name,
title: item.uid
}
}))
}
})
},
minLength: 1,
select: function(event, ui) {
$("#scenarioUid").val(ui.item.title);
}
});
});
</script>
<div id="openScenarioDialog" class="popupForm" title="Open Scenario">
<g:form target="_top" base="." action="openScenarioSubmit" controller="workspace" name="openScenarioForm">
<div class="search form-row ui-widget">
<label for="scenarioName">Scenario Name: </label>
<input type="text" id="scenarioName" name="scenarioName" />
<input type="hidden" id="scenarioUid" name="scenarioUid"/>
</div>
</g:form>
</div>
Keine Kommentare:
Kommentar veröffentlichen