@using Kreta.Web.Helpers.Grid; @using Kreta.Web.Areas.DualisKepzes.Models; @using Kreta.Enums.ManualEnums; @using Kreta.Resources; @using Kreta.Web.Security; @model DualisKepzohelySearchModel @{ const string gridName = "DualisKepzohelyGrid"; const string searchFormName = "searchForm"; } @section AddSearchPanel { @using (Html.SearchPanelSideBar(searchFormName, gridName)) { @Html.HiddenFor(x => x.SzervezetId) @Html.KretaTextBoxFor(x => x.KepzohelyNeve).RenderSearchPanelSideBar() @Html.KretaTextBoxFor(x => x.KepzohelyAdoszama).RenderSearchPanelSideBar() @Html.KretaTextBoxFor(x => x.KepzohelyCime).RenderSearchPanelSideBar() @Html.KretaRangeNumericSideBar(x => x.TanulokSzamaTol, x => x.TanulokSzamaIg, precision: 0, needTolIgLabels: true, step: 1.0) @Html.KretaRangeNumericSideBar(x => x.OktatokSzamaTol, x => x.OktatokSzamaIg, precision: 0, needTolIgLabels: true, step: 1.0) @Html.KretaRangeNumericSideBar(x => x.CsoportokSzamaTol, x => x.CsoportokSzamaIg, precision: 0, needTolIgLabels: true, step: 1.0) @Html.KretaRangeNumericSideBar(x => x.TantargyakSzamaTol, x => x.TantargyakSzamaIg, precision: 0, needTolIgLabels: true, step: 1.0) @Html.KretaRangeNumericSideBar(x => x.HelyszinSzamaTol, x => x.HelyszinSzamaIg, precision: 0, needTolIgLabels: true, step: 1.0) } } @{ var rowFunctions = new List { }; var functionCommands = new List { }; var conditionalRowFunctions = new List { }; conditionalRowFunctions.Add(new RowFunction { Name = IntezmenyResource.Modositas, ClientAction = "DualisKepzohelyHelper.openModify", IconEnum = GridRowFunctionIconEnum.Modositas }); rowFunctions.Add(new RowFunction { Name = IntezmenyResource.Adatok, ClientAction = "DualisKepzohelyHelper.openInfo", IconEnum = GridRowFunctionIconEnum.Adatok }); conditionalRowFunctions.Add(new RowFunction { Name = IntezmenyResource.Torles, ClientAction = "DualisKepzohelyHelper.deleteConfirm", IconEnum = GridRowFunctionIconEnum.Torles }); if (ClaimData.FelhasznaloSzerepkor == Kreta.Enums.SzerepkorTipusEnum.Adminisztrator) { functionCommands.Add(new FunctionCommand { Name = IntezmenyResource.Uj, ClientAction = "DualisKepzohelyHelper.openNew" }); functionCommands.Add(new FunctionCommand { Name = IntezmenyResource.KijeloltekTorlese, ClientAction = "function() { DualisKepzohelyHelper.deleteSelected('" + gridName + "'); }", Classes = "kendo-gridFunctionKommandRed" }); } functionCommands.Add(new FunctionCommand { Name = ImportExportCommonResource.Export.ToUpper(), NestedCommands = new List { new FunctionCommand { Name = ImportExportCommonResource.Export, ClientAction = "DualisKepzohelyHelper.getExport" } } }); var grid = Html.KretaGrid ( name: gridName, getUrl: new GridApiUrl(Constants.ApiControllers.DualisKepzohelyApi, "GetDualisKepzohelyGrid", new Dictionary { { "parentId", "" } }), dataParameterFunction: searchFormName, clientTemplate: "detailGrid-template", clientTemplateUrl: @Url.Action("GetAlSzervezetek", Constants.Controllers.DualisKepzohely, new { area = Constants.Areas.DualisKepzes }), allowScrolling: true, sort: sort => sort.Add(m => m.KepzohelyNeve).Ascending() ) .SelectBoxColumn(Html, string.Empty); if (!ClaimData.IsSelectedTanevIsElozo) { grid.LinkButtonColumn(string.Empty, c => c.KepzohelyNeve, "DualisKepzohelyHelper.openModifyOropenInfo", GridButtonsEnum.Modositas, width: "20%"); } else { grid.Columns(columns => {columns.Bound(c => c.KepzohelyNeve).Width("20%"); }); } grid.Columns(columns => { columns.Bound(c => c.ID).Hidden(); columns.Bound(c => c.KepzohelyAdoszama).Width("20%"); columns.Bound(c => c.KepzohelyCime); columns.Bound(c => c.TanulokSzama); columns.Bound(c => c.OktatokSzama); columns.Bound(c => c.CsoportokSzama); columns.Bound(c => c.TantargyakSzama); columns.Bound(c => c.HelyszinekSzama); }) .ConditionalRowFunction(Html, new List { new RowFunction { Name = IntezmenyResource.Uj, ClientAction = "DualisKepzohelyHelper.openNewSub", IconEnum = GridRowFunctionIconEnum.Uj } }, "DualisKepzohelyHelper.isUjAdhato", 1) .RowFunction(Html, rowFunctions) .FunctionCommand(Html, functionCommands) .ConditionalRowFunction(Html, conditionalRowFunctions, "DualisKepzohelyHelper.isSzerkesztheto", 2) .Sortable(sortable => sortable .AllowUnsort(true) .SortMode(GridSortMode.MultipleColumn)); }
@(grid)
@Html.KretaGridTemplate("detailGrid-template")