v1.1.3.0
This commit is contained in:
@@ -388,9 +388,9 @@
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Data entry.
|
||||
sax.clearControlErrors = function ()
|
||||
sax.clearControlErrors = function (context)
|
||||
{
|
||||
var $ctrls = $('.sax-form-control').removeClass('sax-error');
|
||||
var $ctrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||
$('.sax-message', $ctrls).empty();
|
||||
}
|
||||
sax.clearControlError = function (sel)
|
||||
@@ -404,10 +404,10 @@
|
||||
var $ctrl = $(sel).closest('.sax-form-control').addClass('sax-error');
|
||||
$('.sax-message', $ctrl).text(error);
|
||||
}
|
||||
sax.refreshControlValues = function (controlValues)
|
||||
sax.refreshControlValues = function (controlValues, context)
|
||||
{
|
||||
var $frmCtrls = $('.sax-form-control').removeClass('sax-error');
|
||||
sax.clearControlErrors();
|
||||
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||
sax.clearControlErrors(context);
|
||||
var values = (controlValues || []);
|
||||
var valuesLen = values.length;
|
||||
for (var valIdx = 0; valIdx < (controlValues || []).length; valIdx++)
|
||||
|
||||
@@ -265,8 +265,10 @@
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
if (!response.success) return;
|
||||
sax.$dlg.organisation.dialog('close');
|
||||
|
||||
var item = response.organisation;
|
||||
sax.refreshItem(response.organisation);
|
||||
}
|
||||
sax.refreshItem=function(item)
|
||||
{
|
||||
var $item = $('#' + sax.itemIdPrefix + item.id);
|
||||
if (!$item.length)
|
||||
{
|
||||
@@ -287,14 +289,48 @@
|
||||
sax.showActivationInfo = function (response)
|
||||
{
|
||||
sax.debug('showActivationInfo', response);
|
||||
if (!response.success || !response.organisation) return;
|
||||
let item = response.organisation;
|
||||
let $dlg = sax.$dlg.activate;
|
||||
let $frm = $('#frmOrganisationActivation');
|
||||
|
||||
$('.OrganisationId', $frm).val($('.OrganisationId', sax.$frm.organisationId).val());
|
||||
sax.openDialog(sax.$dlg.activate, 480, 640);
|
||||
let popItemValue = function (sel, val)
|
||||
{
|
||||
$(sel, $frm).toggle(!!val).find('.sax-value').text(val);
|
||||
}
|
||||
popItemValue('.OrganisationName', item.name);
|
||||
popItemValue('.OrganisationSport', item.sportName);
|
||||
popItemValue('.OrganisationRegion', item.regionNameCountry);
|
||||
popItemValue('.OrganisationCategory', item.categoryDesc);
|
||||
popItemValue('.OrganisationAddress', item.addressSummary);
|
||||
let $orgMbrs = $('.OrganisationMembers', $dlg).empty();
|
||||
let $mbrTmpl = $('.sax-panel-item-template tr.sax-item.Member');
|
||||
sax.debug(response.members, $orgMbrs, $mbrTmpl);
|
||||
for (let idx = 0; idx < response.members.length; idx++)
|
||||
{
|
||||
let item = response.members[idx];
|
||||
let $item = $mbrTmpl.clone();
|
||||
$('.MemberId', $item).val(item.id);
|
||||
$('.MemberActivate', $item).prop('name','MemberActivate_' + item.id)
|
||||
$('.MemberEmail', $item).text(item.emailAddress);
|
||||
$('.MemberName', $item).text(item.displayName);
|
||||
$orgMbrs.append($item);
|
||||
sax.debug($item);
|
||||
}
|
||||
sax.openDialog($dlg, 480, 640);
|
||||
}
|
||||
sax.axctivateOrganisation = function ()
|
||||
sax.activateOrganisation = function ()
|
||||
{
|
||||
let $frm = $('#frmOrganisationActivation');
|
||||
sax.ajax.activateOrganisation = sax.ajax.activateOrganisation || { url: sax.url.base + 'Organisation/Ajax/Activate', formId: $frm.prop('id'), callbackFn: sax.handleAtivateResponse };
|
||||
sax.doAjaxRequest(sax.ajax.activateOrganisation, 50);
|
||||
}
|
||||
sax.handleAtivateResponse = function (response)
|
||||
{
|
||||
sax.debug('handleAtivateResponse', response);
|
||||
if (!response.success) return;
|
||||
sax.$dlg.activate.dialog('close');
|
||||
sax.refreshItem(response.organisation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -328,7 +364,7 @@
|
||||
sax.$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
||||
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.axctivateOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.activateOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
sax.$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user