| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Appendix.AppendixDataModel>
- <script>
- var deleteId;
- var gridScrollHeight;
- var gridScrollOffset = 240;
- var resizeFinished;
- $(document).ready(function () {
- gridScrollHeight = calculateGridScrollHeight();
- setTimeout(function () {
- devGridViewAppendix.PerformCallback();
- }, 500);
- });
- $(window).resize(function () {
- clearTimeout(window.resizedFinished);
- window.resizedFinished = setTimeout(function () {
- setGridScrollHeight();
- }, 250);
- });
- function calculateGridScrollHeight() {
- var windowHeight = $(window).height();
- var gridHeaderHeight = $("#devGridViewAppendix_DXHeadersRow0").height();
- var gridFooterHeight = $("#devGridViewAppendix_DXFooterRow").height();
- return windowHeight - gridHeaderHeight - gridFooterHeight - gridScrollOffset;
- }
- function setGridScrollHeight() {
- gridScrollHeight = calculateGridScrollHeight();
- devGridViewAppendix.PerformCallback();
- }
- function onToolbarItemClick(s, e) {
- if (!s || !e) return;
- if (e.item.name == "Print") {
- parent.$(".printPopupContainer").remove();
- $.ajax({
- type: "POST",
- url: '@Url.Action("ExportPartialAppendices", "Appendix")',
- data: { displayMode: "popup", exportFormat: "" },
- success: function (response) {
- parent.$("body").append(response);
- parent.exportFormat = "pdf";
- }
- });
- } else if (e.item.name == "ToggleColumnChooser") {
- if (devGridViewAppendix.IsCustomizationWindowVisible())
- devGridViewAppendix.HideCustomizationWindow();
- else
- devGridViewAppendix.ShowCustomizationWindow();
- }
- }
- function editAppendix(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("EditAppendix", "Appendix")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- $(".appendixEditContainer").remove();
- $("body").append(response);
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function confirmDelete(id) {
- if (!id) return;
- deleteId = id;
- $.ajax({
- type: "GET",
- url: '@Url.Action("GetAppendix", "Appendix")',
- data: { Id: id },
- success: function (response) {
- if (response == "notFound") return;
- var appendix = JSON.parse(response);
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteAppendix);
- popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{appendix}", appendix.CustomNumber));
- $(".dialogText").text($(".dialogText").text().replace("{appendix}", appendix.CustomNumber));
- popupControl.Show();
- }
- });
- }
- function deleteAppendix() {
- $.ajax({
- type: "POST",
- url: '@Url.Action("DeleteAppendix", "Appendix")',
- data: { Id: deleteId },
- success: function (response) {
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteAppendix);
- popupControl.Hide();
- setTimeout(function () {
- devGridViewAppendix.PerformCallback();
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- </script>
- @Html.Partial("~/Views/Appendices/_AppendixGridPartial.cshtml", Model)
- @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
- {
- PopupName = "devPopupControlDeleteAppendix",
- Content = "<div class='dialogText' style='padding: 12px'>Sind Sie sicher, dass Sie den Nachtrag \"{appendix}\" löschen möchten?</div>",
- HeaderText = "\"{appendix}\" löschen",
- YesFunction = "function (s, e) { deleteAppendix(); }"
- })
|