200 lines
7.4 KiB
Text
200 lines
7.4 KiB
Text
@using Kreta.Resources
|
|
@using Kreta.Web.Areas.GRModul.Models;
|
|
|
|
@model UzletiTervSearchModel
|
|
|
|
@{
|
|
var azonosito = Model != null ? Model.SelectedRovatAzonosito : "";
|
|
var exportFileName = ViewData[GRModulResource.IntezmenyAzonositoKey] + "-uzletitervezes.xlsx";
|
|
}
|
|
|
|
<style>
|
|
.KretaJsGrid .k-filtercell > span > .k-button {
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
}
|
|
|
|
.KretaJsGrid .k-pager-wrap .k-pager-nav span {
|
|
margin-top: -5px;
|
|
}
|
|
|
|
a.k-button.k-button-icontext.k-grid-excel {
|
|
display: none !important;
|
|
}
|
|
.k-pager-wrap.k-grid-pager.k-widget.k-floatwrap {
|
|
font-size: 25px;
|
|
}
|
|
</style>
|
|
|
|
@section AddSearchPanel {
|
|
@using (Html.SearchPanelSideBar("searchForm", string.Empty, postSubmitFunction: "UzletiTervezetHelper.refreshGrid"))
|
|
{
|
|
@Html.KretaComboBoxFor(x => x.Honap, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanitasiHonapok" }), htmlAttributes: new Dictionary<string, object> { { "id", "HonapDropDown" } }, useGroup: true).RenderSearchPanelSideBar();
|
|
|
|
}
|
|
}
|
|
|
|
<div class="text-center displayMsg">
|
|
<b>@GRModulResource.KerjukHasznaljaASzuroket</b>
|
|
</div>
|
|
<br/>
|
|
|
|
<a class="k-button k-button-icontext" href="#" onclick="UzletiTervezetHelper.exportData()">@GRModulResource.ExportalasExcelben</a>
|
|
<div class="KretaJsGrid" id="UzletiTervezesGrid"></div>
|
|
|
|
@section AddJs{
|
|
<script type="text/javascript">
|
|
var UzletiTervezetHelper = (function () {
|
|
var helper = function () { };
|
|
const azonosito = '@azonosito';
|
|
const gridId = "UzletiTervezesGrid";
|
|
const urls = {
|
|
GetUzletiTervek: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "UzletiTervezesApi", action = "GetAlkalmazottTenyAdatok" })",
|
|
}
|
|
|
|
helper.refreshGrid = function () {
|
|
AjaxHelper.DoGet(urls.GetUzletiTervek, KretaGridHelper.getSearchParameters('#searchForm'), setGridData);
|
|
$(".displayMsg").hide();
|
|
}
|
|
|
|
helper.exportData = () => {
|
|
exportData();
|
|
}
|
|
|
|
function initGrid(){
|
|
$("#"+gridId).kendoGrid({
|
|
columns: [
|
|
{
|
|
field: "FunkcioTerulet",
|
|
title: "@Html.Raw(GRModulResource.FunkcioTerulet)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "contains",
|
|
suggestionOperator: "contains",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" }
|
|
},
|
|
{
|
|
field: "SzTSzAzonosito",
|
|
title: "@Html.Raw(GRModulResource.SzTSzAzonosito)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "contains",
|
|
suggestionOperator: "contains",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" },
|
|
|
|
},
|
|
{
|
|
field: "AlkalmazottNev",
|
|
title: "@Html.Raw(GRModulResource.Nev)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "contains",
|
|
suggestionOperator: "contains",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" },
|
|
},
|
|
{
|
|
field: "RovatAzonosito",
|
|
title: "@Html.Raw(GRModulResource.Azonosito)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "contains",
|
|
suggestionOperator: "contains",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" },
|
|
},
|
|
{
|
|
field: "RovatSorNev",
|
|
title: "@Html.Raw(GRModulResource.RovatSorNev)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "contains",
|
|
suggestionOperator: "contains",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" },
|
|
},
|
|
{
|
|
field: "Osszeg",
|
|
title: "@Html.Raw(GRModulResource.Osszeg)",
|
|
filterable: {
|
|
cell: {
|
|
operator: "gte",
|
|
suggestionOperator: "gte",
|
|
showOperators: false
|
|
}
|
|
},
|
|
headerAttributes: { style: "text-align: center; vertical-align: top;" },
|
|
}
|
|
],
|
|
filterable: {
|
|
mode: "row"
|
|
},
|
|
pageable: true,
|
|
sortable: {
|
|
mode: "multiple",
|
|
allowUnsort: true,
|
|
},
|
|
toolbar: ["excel"],
|
|
excel: {
|
|
fileName: '@exportFileName',
|
|
filterable: true,
|
|
allPages: true
|
|
}
|
|
});
|
|
|
|
};
|
|
|
|
function setGridData(data) {
|
|
let dataSource;
|
|
|
|
if (azonosito.length > 1) {
|
|
dataSource = new kendo.data.DataSource({
|
|
data: data.Data,
|
|
pageSize: 100,
|
|
filter: {
|
|
field: "RovatAzonosito",
|
|
value: "@azonosito"
|
|
}
|
|
});
|
|
} else {
|
|
dataSource = new kendo.data.DataSource({
|
|
data: data.Data,
|
|
pageSize: 100
|
|
});
|
|
}
|
|
|
|
$("#"+gridId).data("kendoGrid").setDataSource(dataSource);
|
|
}
|
|
|
|
function exportData() {
|
|
let grid = $("#" + gridId).data("kendo-grid");
|
|
|
|
if (grid) {
|
|
grid.saveAsExcel();
|
|
}
|
|
}
|
|
|
|
initGrid();
|
|
|
|
if (azonosito.length > 1) {
|
|
helper.refreshGrid();
|
|
}
|
|
|
|
return helper;
|
|
})();
|
|
|
|
</script>
|
|
}
|
|
|