init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
272
KretaWeb/Helpers/OsztalyCsoportSorolasExtensions.cs
Normal file
272
KretaWeb/Helpers/OsztalyCsoportSorolasExtensions.cs
Normal file
|
@ -0,0 +1,272 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Helpers.OsztalyCsoportSorolas;
|
||||
|
||||
namespace Kreta.Web.Helpers
|
||||
{
|
||||
public static class OsztalyCsoportSorolasExtensions
|
||||
{
|
||||
public static MvcHtmlString KretaOsztalyCsoportSorolas(this HtmlHelper helper, IOsztalyCsoportbaSorolasBase model)
|
||||
{
|
||||
var fromDDL = ComboBoxExtensions.KretaComboBox(helper, "FromDDL", model.FromUrl, "Text", "Value", model.FromPlaceholder).AutoBind(false);
|
||||
var toDDL = ComboBoxExtensions.KretaComboBox(helper, "ToDDL", model.ToUrl, "Text", "Value", model.ToPlaceholder).AutoBind(false);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(model.FromChangeEvent))
|
||||
{ fromDDL.Events(e => e.Change(model.FromChangeEvent)); }
|
||||
if (!string.IsNullOrWhiteSpace(model.ToChangeEvent))
|
||||
{ toDDL.Events(e => e.Change(model.ToChangeEvent)); }
|
||||
|
||||
string result = @"
|
||||
<div class='row'>
|
||||
<div class='col-xs-5'>" + fromDDL.ToHtmlString() + @"</div>
|
||||
<div class='col-xs-2'></div>
|
||||
<div class='col-xs-5'>" + toDDL.ToHtmlString() + @"</div>
|
||||
</div>
|
||||
<div class='row' style='min-height: 0px;'>
|
||||
<div class='col-xs-5' style='min-height: 0px;'>
|
||||
<button id='sortNameFromElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(4898) + @"</button>
|
||||
<button id='sortDateFromElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(4899) + @"</button>
|
||||
<button id='sortNemFromElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(7604) + @"</button>
|
||||
</div>
|
||||
<div class='col-xs-2' style='min-height: 1px;'></div>
|
||||
<div class='col-xs-5' style='min-height: 0px;'>
|
||||
<button id='sortNameToElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(4898) + @"</button>
|
||||
<button id='sortDateToElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(4899) + @"</button>
|
||||
<button id='sortNemToElement' style='min-height: 31px;' class='k-button col-xs-4' type='button'>" + StringResourcesUtil.GetString(7604) + @"</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-5 selectBoxDiv'>
|
||||
<select name='FromElements[]' id='multiselect' class='form-control' size='20' multiple='multiple' style='overflow: scroll; height: 400px;'></select>
|
||||
</div>
|
||||
<div class='col-xs-2'>
|
||||
<button disabled type='button' id='multiselect_rightAll' class='btn btn-block'><i class='glyphicon glyphicon-forward'></i></button>
|
||||
<button disabled type='button' id='multiselect_rightSelected' class='btn btn-block'><i class='glyphicon glyphicon-chevron-right'></i></button>
|
||||
<button disabled type='button' id='multiselect_leftSelected' class='btn btn-block'><i class='glyphicon glyphicon-chevron-left'></i></button>
|
||||
<button disabled type='button' id='multiselect_leftAll' class='btn btn-block'><i class='glyphicon glyphicon-backward'></i></button>
|
||||
<br />
|
||||
<label id='multiSelectErrorMsg'></label>
|
||||
</div>
|
||||
<div class='col-xs-5 selectBoxDiv'>
|
||||
<select name = 'ToElements[]' id='multiselect_to' class='form-control' size='20' multiple='multiple' style='overflow: scroll; height: 400px;'></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-xs-3'>
|
||||
<label id='FromElementsCount'>0</label>
|
||||
<label>" + StringResourcesUtil.GetString(4253) + @"</label>
|
||||
</div>
|
||||
<div class='col-xs-2' style='text-align: right;'>
|
||||
<label id='FromElementsCountIn'>0</label>
|
||||
<label>" + OsztalyCsoportResource.FoOsszesen + @"</label>
|
||||
</div>
|
||||
<div class='col-xs-2'>
|
||||
<label id='multiSelectErrorMsg'></label>
|
||||
</div>
|
||||
<div class='col-xs-3'>
|
||||
<label id='ToElementsCount'>0</label>
|
||||
<label>" + StringResourcesUtil.GetString(4253) + @"</label>
|
||||
</div>
|
||||
<div class='col-xs-2' style='text-align: right;'>
|
||||
<label id='ToElementsCountIn'>0</label>
|
||||
<label>" + OsztalyCsoportResource.FoOsszesen + @"</label>
|
||||
</div>
|
||||
</div>
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function () {
|
||||
$('#multiselect').multiselect(
|
||||
{
|
||||
afterMoveToRight: function() {
|
||||
KretaOsztalybaSorolasHelper.multiselectWithShiftFrom();
|
||||
KretaOsztalybaSorolasHelper.multiselectWithShiftTo();
|
||||
},
|
||||
afterMoveToLeft: function() {
|
||||
KretaOsztalybaSorolasHelper.multiselectWithShiftFrom();
|
||||
KretaOsztalybaSorolasHelper.multiselectWithShiftTo();
|
||||
},
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$('#multiselect').click(function() { $('#FromElementsCount').text($('#multiselect :selected').length); });
|
||||
$('#multiselect_to').click(function() { $('#ToElementsCount').text($('#multiselect_to :selected').length); });
|
||||
|
||||
KretaOsztalybaSorolasHelper.sizeListSelect($('#multiselect'));
|
||||
KretaOsztalybaSorolasHelper.sizeListSelect($('#multiselect_to'));
|
||||
|
||||
$('#sortNameFromElement').click(function() {
|
||||
var options = $('#multiselect option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, d: $(o).attr('szulDatum'), n: $(o).attr('neme'), e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), fromId: $(o).attr('fromId'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(CommonUtils.hunSorterWithKey('e'));
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('disabled'); $(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
});
|
||||
});
|
||||
|
||||
$('#sortDateFromElement').click(function() {
|
||||
var options = $('#multiselect option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), d: $(o).attr('szulDatum'), fromId: $(o).attr('fromId'), n: $(o).attr('neme'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(function(o1, o2) { return new Date(o1.d) - new Date(o2.d); });
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('disabled'); $(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
});
|
||||
});
|
||||
|
||||
$('#sortNemFromElement').click(function() {
|
||||
var options = $('#multiselect option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), d: $(o).attr('szulDatum'), fromId: $(o).attr('fromId'), n: $(o).attr('neme'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(CommonUtils.hunSorterWithKey('n'));
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('disabled'); $(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
});
|
||||
});
|
||||
|
||||
$('#sortNameToElement').click(function() {
|
||||
var options = $('#multiselect_to option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), d: $(o).attr('szulDatum'), fromId: $(o).attr('fromId'), n: $(o).attr('neme'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(CommonUtils.hunSorterWithKey('e'));
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
|
||||
if(typeof arr[i].disabled === 'undefined') { $(o).attr('disabled', false); }
|
||||
});
|
||||
});
|
||||
|
||||
$('#sortDateToElement').click(function() {
|
||||
var options = $('#multiselect_to option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), d: $(o).attr('szulDatum'), fromId: $(o).attr('fromId'), n: $(o).attr('neme'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(function(o1, o2) { return new Date(o1.d) - new Date(o2.d); });
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
|
||||
if(typeof arr[i].disabled === 'undefined') { $(o).attr('disabled', false); }
|
||||
});
|
||||
});
|
||||
|
||||
$('#sortNemToElement').click(function() {
|
||||
var options = $('#multiselect_to option');
|
||||
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value, e: $(o).attr('nevElotagNelkul'), jc: $(o).attr('jogviszonyCount'), ji: $(o).attr('jogviszonyId'), d: $(o).attr('szulDatum'),fromId: $(o).attr('fromId'), n: $(o).attr('neme'), disabled: $(o).attr('disabled'), style: $(o).attr('style'), selected: o.selected, c: $(o).attr('class'), dfi: $(o).attr('data-fa-icon'), ti: $(o).attr('title') }; }).get();
|
||||
arr.sort(CommonUtils.hunSorterWithKey('n'));
|
||||
options.each(function(i, o) {
|
||||
o.value = arr[i].v;
|
||||
o.selected = arr[i].selected;
|
||||
|
||||
$(o).text(arr[i].t);
|
||||
$(o).attr('szulDatum', arr[i].d);
|
||||
$(o).attr('Neme', arr[i].n);
|
||||
$(o).attr('nevElotagNelkul', arr[i].e);
|
||||
$(o).attr('jogviszonyCount', arr[i].jc);
|
||||
$(o).attr('jogviszonyId', arr[i].ji);
|
||||
$(o).attr('fromId', arr[i].fromId);
|
||||
$(o).removeAttr('style');
|
||||
$(o).attr('disabled', arr[i].disabled); $(o).attr('style', arr[i].style);
|
||||
$(o).removeAttr('class');
|
||||
$(o).attr('class', arr[i].c);
|
||||
$(o).removeAttr('data-fa-icon');
|
||||
$(o).attr('data-fa-icon', arr[i].dfi);
|
||||
$(o).removeAttr('title');
|
||||
$(o).attr('title', arr[i].ti);
|
||||
|
||||
if(typeof arr[i].disabled === 'undefined') { $(o).attr('disabled', false); }
|
||||
});
|
||||
});
|
||||
|
||||
$('#multiselect_rightAll, #multiselect_rightSelected, #multiselect_leftSelected, #multiselect_leftAll').click(function() {
|
||||
KretaOsztalybaSorolasHelper.deSelectAllOptions('multiselect');
|
||||
KretaOsztalybaSorolasHelper.deSelectAllOptions('multiselect_to');
|
||||
KretaOsztalybaSorolasHelper.LoadJogviszonyGrid();
|
||||
});
|
||||
},1);
|
||||
});
|
||||
</script>
|
||||
";
|
||||
|
||||
return new MvcHtmlString(result);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue