70 lines
No EOL
3 KiB
Text
70 lines
No EOL
3 KiB
Text
@using Kreta.Web.Helpers.Grid;
|
|
@using Kreta.Web.Areas.DualisKepzes.Models;
|
|
@using Kreta.Enums.ManualEnums;
|
|
@using Kreta.Resources;
|
|
@using Kreta.Web.Security;
|
|
|
|
@model int
|
|
|
|
<div id="partialDetailGrid_@Model.ToString()">
|
|
@{
|
|
string gridName = "DualisKepzohelyGrid_" + Model.ToString();
|
|
}
|
|
|
|
@{
|
|
var rowFunctions = new List<RowFunction> { };
|
|
var conditionalRowFunctions = new List<RowFunction>();
|
|
var functionCommands = new List<FunctionCommand> { };
|
|
|
|
rowFunctions.Add(new RowFunction { Name = IntezmenyResource.Adatok, ClientAction = "DualisKepzohelyHelper.openInfo", IconEnum = GridRowFunctionIconEnum.Adatok });
|
|
conditionalRowFunctions.Add(new RowFunction { Name = IntezmenyResource.Modositas, ClientAction = "DualisKepzohelyHelper.openModify", IconEnum = GridRowFunctionIconEnum.Modositas });
|
|
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" });
|
|
|
|
var gridDetail =
|
|
Html.KretaGrid<DualisKepzohelyGridModel>
|
|
(
|
|
name: gridName,
|
|
getUrl: new GridApiUrl(Constants.ApiControllers.DualisKepzohelyApi, "GetDualisKepzohelyGrid", new Dictionary<string, string> {
|
|
{ "parentId", Model.ToString() }
|
|
}),
|
|
allowScrolling: false,
|
|
sort: sort => sort.Add(m => m.KepzohelyNeve).Ascending()
|
|
)
|
|
.AutoBind(true)
|
|
.SelectBoxColumn(Html, string.Empty);
|
|
if (!ClaimData.IsSelectedTanevIsElozo)
|
|
{
|
|
gridDetail.LinkButtonColumn(string.Empty, c => c.KepzohelyNeve, "DualisKepzohelyHelper.openModifyOropenInfo", GridButtonsEnum.Modositas, width: "20%");
|
|
}
|
|
else
|
|
{
|
|
gridDetail.Columns(columns => {columns.Bound(c => c.KepzohelyNeve).Width("20%"); });
|
|
}
|
|
gridDetail.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);
|
|
})
|
|
.RowFunction(Html, rowFunctions, rowFunctions.Count)
|
|
.ConditionalRowFunction(Html, conditionalRowFunctions, "DualisKepzohelyHelper.isSzerkesztheto", conditionalRowFunctions.Count)
|
|
.FunctionCommand(Html, functionCommands)
|
|
.Sortable(sortable => sortable
|
|
.AllowUnsort(true)
|
|
.SortMode(GridSortMode.MultipleColumn));
|
|
}
|
|
<div>
|
|
@(gridDetail)
|
|
</div>
|
|
|
|
</div> |