65 lines
3.1 KiB
Text
65 lines
3.1 KiB
Text
@using Kreta.Resources;
|
|
@using Kreta.Web.Helpers.Grid;
|
|
@using Kreta.Enums.ManualEnums
|
|
@using Kreta.Web.Areas.Tanulo.Models
|
|
@using Kreta.Web.Areas.Feljegyzes.Models
|
|
@using Kreta.BusinessLogic.Classes
|
|
@model TanuloDetailModel
|
|
|
|
<script>
|
|
|
|
var DetailGridHelper = (function () {
|
|
var detailGridHelper = function () { };
|
|
|
|
detailGridHelper.setAthuzas = function () {
|
|
var gridName = "BeirasokReszletekGrid_" + "@Model.TanuloId";
|
|
var dataSource = KretaGridHelper.getKendoGridData(gridName).dataSource.data();
|
|
$.each(dataSource, function (index, value) {
|
|
if (value.Torolt_BOOL) {
|
|
$('#' + gridName).find('[data-uid= ' + value.uid + ']').addClass("kretaStrikedGridRow disabledItem");
|
|
}
|
|
});
|
|
}
|
|
|
|
detailGridHelper.setRowEditing = function (rowData) {
|
|
return !rowData.Torolt_BOOL && rowData.Modosithato_BOOL;
|
|
}
|
|
|
|
return detailGridHelper;
|
|
})();
|
|
|
|
</script>
|
|
|
|
<div id="partialDetailGrid_@Model.TanuloId">
|
|
@{
|
|
var rowFunctionList = new List<RowFunction>
|
|
{
|
|
new RowFunction { Name = CommonResource.Modositas, ClientAction = "BeirasokHelper.openEditorPopupByTipus", IconEnum = GridRowFunctionIconEnum.Modositas },
|
|
new RowFunction { Name = CommonResource.Torles, ClientAction = "BeirasokHelper.deleteConfirmWindow", IconEnum = GridRowFunctionIconEnum.Torles }
|
|
};
|
|
}
|
|
|
|
@(
|
|
Html.KretaGrid<BeirasokReszletekGridModel>(
|
|
"BeirasokReszletekGrid_" + Model.TanuloId,
|
|
new GridApiUrl("BeirasokApi", "GetBeirasokReszletekGrid", new Dictionary<string, string> { { "tanuloId", Model.TanuloId.ToString() } }),
|
|
useToolBar: false,
|
|
allowSorting: false,
|
|
allowPaging: false,
|
|
pageSizes: null,
|
|
dataBoundAdditionalFunction: "DetailGridHelper.setAthuzas();",
|
|
sort: sort => sort.Add(s => s.EsemenyDatuma).Descending()
|
|
)
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(c => c.ID).Hidden();
|
|
columns.Bound(c => c.TanuloId).Hidden();
|
|
columns.Bound(c => c.EsemenyDatuma).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("10%");
|
|
columns.Bound(c => c.FeljegyzoNeve).Width("15%");
|
|
columns.Bound(c => c.Tipus_DNAME).Width("25%");
|
|
columns.Bound(c => c.Targy).Width("20%").SetDisplayPropertyWithToolip("Targy");
|
|
columns.Bound(c => c.Tartalom).Width("30%").SetDisplayPropertyWithToolip("Tartalom");
|
|
})
|
|
.ConditionalRowFunction(Html, rowFunctionList, "DetailGridHelper.setRowEditing")
|
|
)
|
|
</div>
|