v1.1.1.0
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Organisation Request.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let or = sax.orgReq;
|
||||
or.fn = {}; or.ajax = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.fn.requestOrganisation = function ()
|
||||
{
|
||||
or.fn.init();
|
||||
sax.openDialog(or.$dlg, 640, 760);
|
||||
}
|
||||
or.fn.storeOrganisation = function ()
|
||||
{
|
||||
//sax.debug('refreshResults');
|
||||
or.ajax.registerOrg = or.ajax.registerOrg || { url: sax.url.base + 'Organisation/Ajax/requestOrganisation', formId: 'frmOrganisationRequest', callbackFn: or.fn.handleRequestOrganisationResponse };
|
||||
sax.doAjaxRequest(or.ajax.registerOrg, 50);
|
||||
}
|
||||
or.fn.handleRequestOrganisationResponse = function (response)
|
||||
{
|
||||
sax.debug('or.handleRequestOrganisationResponse', response);
|
||||
if (!response.success) return;
|
||||
|
||||
}
|
||||
or.fn.cleanUp = function ()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.selectOrgSport = function ()
|
||||
{
|
||||
sax.data.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('.OrganisationSportId', or.$frm).val(), fnCallback: sax.onSelectOrgSport })
|
||||
}
|
||||
sax.onSelectOrgSport = function (sport)
|
||||
{
|
||||
sax.clearControlError($('.OrganisationSportId', or.$frm).val(sport.id));
|
||||
$('.OrganisationSportCaption', or.$frm).val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.selectOrgRegion = function ()
|
||||
{
|
||||
sax.data.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.OrganisationRegionId', 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 : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.fn.init = function ()
|
||||
{
|
||||
if (or.$dlg) return;
|
||||
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'); };
|
||||
or.$dlg = $('#dlgOrganisationRequest').dialog(opt);
|
||||
or.$frm = $('#frmOrganisationRequest', or.$dlg);
|
||||
}
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
Reference in New Issue
Block a user