74 lines
No EOL
3.3 KiB
Text
74 lines
No EOL
3.3 KiB
Text
@using Kreta.BusinessLogic.HelperClasses
|
|
@using Kreta.Web.Models
|
|
@using Kreta.Resources
|
|
@using Kreta.Web.Helpers
|
|
@using Kreta.Enums
|
|
|
|
@model AmiKepzesiJellemzokModel
|
|
|
|
@Html.HiddenFor(x => x.MuveszetiAgValidationAttr)
|
|
@Html.HiddenFor(x => x.IsRequiredAmiKepzesiJellemzok)
|
|
|
|
<div class="row">
|
|
@Html.KretaComboBoxFor(x => x.MuveszetiAgId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetMuveszetiAgList" }), "Text", "Value").Events(e => e.Change("function(e) {muveszetiAgChange(e)}")).AutoBind(true).RenderWithName(3, 3, allSizeSame: true)
|
|
|
|
<div id="tanszakTipusDiv">
|
|
@Html.KretaComboBoxFor(x => x.TanszakTipusId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanszakTipusList" }), "Text", "Value").AutoBind(true).RenderWithName(3, 3, allSizeSame: true)
|
|
</div>
|
|
</div>
|
|
<div class="row" id="MufajTipusRowDiv">
|
|
@Html.KretaComboBoxFor(x => x.MufajTipusId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetMufajTipusList" }), "Text", "Value").AutoBind(true).RenderWithName(3, 3, allSizeSame: true)
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function muveszetiAgChange(e) {
|
|
var muveszetiAgComboboxValue = "";
|
|
if ($.isNumeric(e)) {
|
|
var muveszetiAgComboboxValue = e;
|
|
}
|
|
else {
|
|
if (!CommonUtils.isNullOrUndefined(e.sender && !CommonUtils.isNullOrUndefined(e.sender.value()))) {
|
|
muveszetiAgComboboxValue = e.sender.value();
|
|
}
|
|
}
|
|
|
|
if (!CommonUtils.isNullOrEmpty(muveszetiAgComboboxValue)
|
|
&& "@(Model.ZenemuveszetiAgId)" === muveszetiAgComboboxValue) {
|
|
$("#MufajTipusId").parent().removeClass("disabledItem");
|
|
|
|
if (CommonUtils.isNullOrEmpty($("#MufajTipusId").data("kendoComboBox").value())) {
|
|
$("#MufajTipusId").data("kendoComboBox").value("@Model.MufajTipusIdDefaultValue");
|
|
}
|
|
setMufajTipusRequiredAttribute($("#MufajTipusId"), true);
|
|
}
|
|
else {
|
|
$("#MufajTipusId").parent().addClass("disabledItem");
|
|
$("#MufajTipusId").data("kendoComboBox").value('');
|
|
setMufajTipusRequiredAttribute($("#MufajTipusId"), false);
|
|
}
|
|
};
|
|
|
|
function setMufajTipusRequiredAttribute(e, isRequired) {
|
|
if (isRequired) {
|
|
$("#MuveszetiAgValidationAttr").val(true);
|
|
if ($("[for*='MufajTipusId']").text().indexOf("*") === -1 ) {
|
|
$("[for*='MufajTipusId']").append($("<span>", { "class": "required-indicator", "style": "padding-left:4px" }).text("*"));
|
|
}
|
|
}
|
|
else {
|
|
$("#MuveszetiAgValidationAttr").val(false);
|
|
$("[for*='MufajTipusId'] .required-indicator").remove();
|
|
}
|
|
};
|
|
|
|
$(document).ready(function () {
|
|
if (CommonUtils.isNullOrEmpty($("#MuveszetiAgId").data("kendoComboBox").value())) {
|
|
$("#MufajTipusId").parent().addClass("disabledItem");
|
|
$("#MufajTipusId").data("kendoComboBox").value('');
|
|
setMufajTipusRequiredAttribute($("#MufajTipusId"), false);
|
|
} else {
|
|
muveszetiAgChange($("#MuveszetiAgId").data("kendoComboBox").value());
|
|
}
|
|
});
|
|
</script> |