105 lines
3.6 KiB
Text
105 lines
3.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<OsztalyLeptetesGridModel>(
|
|
"OsztalyLeptetesGrid",
|
|
new GridApiUrl("OsztalyLeptetesApi", "GetOsztalyLeptetesGrid"),
|
|
allowFilterable: false,
|
|
allowSorting: true,
|
|
useToolBar: true
|
|
).TableHtmlAttributes(new { @class = "tableLayoutFixed" });
|
|
|
|
grid.Columns(columns =>
|
|
{
|
|
columns.Bound(x => x.Tanev).Width("100px");
|
|
columns.Bound(x => x.OsztalyNeve).Width("200px");
|
|
columns.Bound(x => x.Evfolyam).Width("100px");
|
|
});
|
|
|
|
grid.Columns(columns =>
|
|
{
|
|
columns.Bound(x => x.KovTanev).Width("100px").Sortable(false);
|
|
columns.Bound(x => x.OsztalyJavasoltNeve).Width("200px").Sortable(false);
|
|
columns.Bound(x => x.JavasoltEvfolyam).Width("100px").Sortable(false);
|
|
});
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).ClientTemplate(
|
|
grid.TextBoxForColumnTemplate(Html.For<OsztalyLeptetesGridModel>(), x => x.EditOsztalyNeve)
|
|
).Title(LeptetesResource.OsztalyNeve).Width(200);
|
|
});
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).ClientTemplate(
|
|
grid.ComboBoxForColumnTemplateWidthValue(Html.For<OsztalyLeptetesGridModel>(), x => x.EditEvfolyam, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperApi", action = "GetEvfolyamListForCombo" }))
|
|
).Title(LeptetesResource.Evfolyam).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.AKijeloltOsztalyokLetrehozasaKovTanevben, ClientAction = "LeptetesHelper.saveOsztalyLeptetes()" } });
|
|
|
|
}
|
|
|
|
<div class="container-fluid details">
|
|
<div class="row">
|
|
@(grid)
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
table td:nth-child(4), table th:nth-child(4) {
|
|
border-right: 4px solid #406a7c !important;
|
|
}
|
|
|
|
table td:nth-child(7), table th:nth-child(7) {
|
|
border-right: 1px solid #406a7c !important;
|
|
}
|
|
|
|
table td:nth-child(9), table th:nth-child(9) {
|
|
border-right: 1px solid #406a7c !important;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
var LeptetesHelper = (function () {
|
|
var helper = function () { };
|
|
|
|
var gridName = "OsztalyLeptetesGrid";
|
|
var url = {
|
|
saveOsztalyLeptetes: "@Url.HttpRouteUrl("ActionApi", new { controller = "OsztalyLeptetesApi", action = "SaveOsztalyLeptetes" })"
|
|
}
|
|
|
|
helper.saveOsztalyLeptetes = function () {
|
|
var data = []; var isError = false;
|
|
var modRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
|
|
|
$.each(modRows, function (i, v) {
|
|
if (v.ki_EditOsztalyNeve == '') { isError = true; }
|
|
data.push({
|
|
SourceID: v.ID,
|
|
Nev: v.ki_EditOsztalyNeve,
|
|
Evfolyam: $("#" + gridName + "_EditEvfolyam_" + v.ID).val()
|
|
});
|
|
});
|
|
|
|
if (!isError)
|
|
AjaxHelper.DoPost(url.saveOsztalyLeptetes, data, successResponse);
|
|
else
|
|
KretaWindowHelper.notification("@LeptetesResource.OsztalyKotelezo", "error");
|
|
}
|
|
|
|
function successResponse() {
|
|
KretaWindowHelper.successFeedBackWindow();
|
|
KretaGridHelper.refreshGrid(gridName);
|
|
}
|
|
|
|
return helper;
|
|
})();
|
|
</script>
|