This commit is contained in:
2021-07-10 14:23:14 +01:00
parent 03ea1058be
commit 10907d3aff
97 changed files with 2048 additions and 521 deletions
@@ -12,6 +12,10 @@
or.fn.requestOrganisation = function ()
{
or.fn.init();
$('input[type="text"],textarea,select,.OrganisationSportId,.OrganisationRegionIdCountry', or.$frm).val('');
$('.OrganisationRegionIdCountry', or.$frm).val(sax.data.regionIdCountryDefault);
$('.OrganisationRegionCaptionCountry', or.$frm).val(sax.data.regionNameCountryDefault);
sax.clearControlErrors(or.$frm);
sax.openDialog(or.$dlg, 640, 760);
}
or.fn.storeOrganisation = function ()
@@ -23,8 +27,11 @@
or.fn.handleRequestOrganisationResponse = function (response)
{
sax.debug('or.handleRequestOrganisationResponse', response);
if (!response) return;
sax.refreshControlValues(response.controlValues, or.$frm);
if (!response.success) return;
or.$dlg.dialog('close');
or.fn.cleanUp();
}
or.fn.cleanUp = function ()
{
@@ -44,12 +51,12 @@
//--------------------------------------------------------------
sax.selectOrgRegion = function ()
{
sax.data.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.OrganisationRegionId', or.$frm).val(), typesInc:[30], fnCallback: sax.onSelectOrgRegion })
sax.data.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.OrganisationRegionIdCountry', or.$frm).val(), typesInc:[30], fnCallback: sax.onSelectOrgRegion })
}
sax.onSelectOrgRegion = function (region)
{
sax.clearControlError($('.OrganisationRegionId', or.$frm).val(region.id));
$('.OrganisationRegionCaption', or.$frm).val(region ? region.name : '');
sax.clearControlError($('.OrganisationRegionIdCountry', or.$frm).val(region.id));
$('.OrganisationRegionCaptionCountry', or.$frm).val(region ? region.name : '');
}
//--------------------------------------------------------------
@@ -59,9 +66,11 @@
var opt = sax.dlgOpts();
opt.title = sax.orgReq.dlgTitleRequestOrganisation;
opt.buttons[sax.dlg.btn.ok] = function () { or.fn.storeOrganisation(); };
opt.buttons[sax.dlg.btn.cancel] = function () { or.fn.cleanUp(); $(this).dialog('close'); };
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); or.fn.cleanUp(); };
or.$dlg = $('#dlgOrganisationRequest').dialog(opt);
or.$frm = $('#frmOrganisationRequest', or.$dlg);
$('.sax-input, .sax-textarea', or.$frm).on('input', function () { sax.clearControlError(this); });
$('.sax-select', or.$frm).on('change', function () { sax.clearControlError(this); });
}
}(window, window.document));