| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Misc.LogDataModel>
- <script>
- var gridScrollHeight;
- var gridScrollOffset = 250;
- var resizeFinished;
- $(document).ready(function () {
- gridScrollHeight = calculateGridScrollHeight();
- setTimeout(function () {
- devGridViewLog.PerformCallback();
- }, 500);
- });
- $(window).resize(function () {
- clearTimeout(window.resizedFinished);
- window.resizedFinished = setTimeout(function () {
- setGridScrollHeight();
- }, 250);
- });
- function calculateGridScrollHeight() {
- var windowHeight = $(window).height();
- var gridHeaderHeight = $("#devGridViewLog_DXHeadersRow0").height();
- var gridFooterHeight = $("#devGridViewLog_DXFooterRow").height();
- return windowHeight - gridHeaderHeight - gridFooterHeight - gridScrollOffset;
- }
- function setGridScrollHeight() {
- gridScrollHeight = calculateGridScrollHeight();
- devGridViewLog.PerformCallback();
- }
- function onToolbarItemClick(s, e) {
- if (!s || !e) return;
- if (IsExportToolbarCommand(e.item.name)) {
- $("#Format").val(e.item.name);
- $("#logExportForm").submit();
- } else if (e.item.name == "ToggleColumnChooser") {
- if (devGridViewLog.IsCustomizationWindowVisible())
- devGridViewLog.HideCustomizationWindow();
- else
- devGridViewLog.ShowCustomizationWindow();
- }
- }
- function IsExportToolbarCommand(command) {
- return command == "Pdf" || command == "Xlsx" || command == "Xls";
- }
- function viewLog(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("viewLog", "Misc")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- $(".logViewContainer").remove();
- $("body").append(response);
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function deleteLog(id) {
- $.ajax({
- type: "POST",
- url: '@Url.Action("DeleteLog", "Misc")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- devGridViewLog.PerformCallback();
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- </script>
- @using (Html.BeginForm("ExportPartialLogs", "Misc", FormMethod.Post, new { id = "logExportForm" }))
- {
- @Html.Hidden("Format")
- }
- @Html.Partial("~/Views/Misc/_LogGridPartial.cshtml", Model)
|