124 lines
No EOL
4.6 KiB
Text
124 lines
No EOL
4.6 KiB
Text
@using Kreta.Web.Helpers.Grid
|
|
@using Kreta.Web.Helpers
|
|
@using Kreta.Web.Areas.Leptetes.Models
|
|
@using Kreta.Resources
|
|
|
|
@{
|
|
var grid = Html.KretaGrid<CsoportLeptetesGridModel>(
|
|
"CsoportLeptetesGrid",
|
|
new GridApiUrl("CsoportLeptetesApi", "GetCsoportLeptetesGrid"),
|
|
allowFilterable: false,
|
|
allowSorting: true,
|
|
useToolBar: true
|
|
).TableHtmlAttributes(new { @class = "tableLayoutFixed" });
|
|
|
|
grid.Columns(columns =>
|
|
{
|
|
columns.Bound(x => x.Tanev).Width("100px");
|
|
columns.Bound(x => x.CsoportNeve).Width("200px");
|
|
columns.Bound(x => x.Evfolyam).Width("100px");
|
|
columns.Bound(x => x.Osztalybontas).Width("100px");
|
|
});
|
|
|
|
grid.Columns(columns =>
|
|
{
|
|
columns.Bound(x => x.KovTanev).Width("100px").Sortable(false);
|
|
columns.Bound(x => x.CsoportJavasoltNeve).Width("200px").Sortable(false);
|
|
columns.Bound(x => x.JavasoltEvfolyam).Width("100px").Sortable(false);
|
|
columns.Bound(x => x.JavasoltOsztalybontas).Width("100px").Sortable(false);
|
|
});
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).ClientTemplate(
|
|
grid.TextBoxForColumnTemplate(Html.For<CsoportLeptetesGridModel>(), x => x.EditCsoportNeve)
|
|
).Title(LeptetesResource.CsoportNeve).Width(200);
|
|
});
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).ClientTemplate(
|
|
grid.ComboBoxForColumnTemplateWidthValue(Html.For<CsoportLeptetesGridModel>(), x => x.EditEvfolyam, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamListForCombo" }))
|
|
).Title(LeptetesResource.Evfolyam).Width(200);
|
|
});
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).ClientTemplate(
|
|
grid.ComboBoxForColumnTemplateWidthValue(Html.For<CsoportLeptetesGridModel>(), x => x.EditOsztalybontas, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetKovTanevOsztalyok" }), "LeptetesHelper.changeOsztalyBontas")
|
|
).Title(LeptetesResource.Osztalybontas).Width(200);
|
|
});
|
|
|
|
grid.Sortable(sortable => sortable.AllowUnsort(true).SortMode(GridSortMode.MultipleColumn));
|
|
|
|
grid.SelectBoxColumn(Html, LeptetesResource.Letrehozas, width: 100);
|
|
grid.FunctionCommand(Html, new List<FunctionCommand>() { new FunctionCommand() { Name= @LeptetesResource.AKijeloltCsoportokLetrehozasaKovTanevben, ClientAction = "LeptetesHelper.saveCsoportLeptetes()" } });
|
|
}
|
|
|
|
<div class="container-fluid details">
|
|
<div class="row">
|
|
@(grid)
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
table td:nth-child(5), table th:nth-child(5) {
|
|
border-right: 4px solid #406a7c !important;
|
|
}
|
|
|
|
table td:nth-child(9), table th:nth-child(9) {
|
|
border-right: 1px solid #406a7c !important;
|
|
}
|
|
|
|
table td:nth-child(12), table th:nth-child(12) {
|
|
border-right: 1px solid #406a7c !important;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
var LeptetesHelper = (function () {
|
|
var helper = function () { };
|
|
|
|
var gridName = "CsoportLeptetesGrid";
|
|
var url = {
|
|
saveCsoportLeptetes: "@Url.HttpRouteUrl("ActionApi", new { controller = "CsoportLeptetesApi", action = "SaveCsoportLeptetes" })"
|
|
}
|
|
|
|
helper.saveCsoportLeptetes = function () {
|
|
var data = []; var isError = false;
|
|
var modRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
|
|
|
$.each(modRows, function (i, v) {
|
|
if (v.ki_EditCsoportNeve == '') { isError = true; }
|
|
data.push({
|
|
SourceID: v.ID,
|
|
Nev: v.ki_EditCsoportNeve,
|
|
Evfolyam: $("#" + gridName + "_EditEvfolyam_" + v.ID).val(),
|
|
Osztalybontas: $("#" + gridName + "_EditOsztalybontas_" + v.ID).val()
|
|
});
|
|
});
|
|
|
|
if (!isError)
|
|
AjaxHelper.DoPost(url.saveCsoportLeptetes, data, successResponse);
|
|
else
|
|
KretaWindowHelper.notification("@LeptetesResource.CsoportKotelezo", "error");
|
|
}
|
|
|
|
helper.changeOsztalyBontas = function (data) {
|
|
var obj = $("#" + data.sender.element[0].id);
|
|
if (obj.val() == '-1') {
|
|
obj.closest('td').prev('td').css({ 'opacity': '1' }).removeClass("disabledItem");
|
|
}
|
|
else {
|
|
obj.closest('td').prev('td').css({ 'opacity': '0' }).addClass("disabledItem");
|
|
}
|
|
}
|
|
|
|
function successResponse() {
|
|
KretaWindowHelper.successFeedBackWindow();
|
|
KretaGridHelper.refreshGrid(gridName);
|
|
}
|
|
|
|
return helper;
|
|
})();
|
|
</script> |