3.0.1.2 Requirements & tidy
This commit is contained in:
@@ -198,7 +198,7 @@
|
||||
}
|
||||
co.onCreateAssociation = function (env, item)
|
||||
{
|
||||
sbm.debug('onCreateAssociation', env, item);
|
||||
//sbm.debug('onCreateAssociation', env, item);
|
||||
let $frm = env.$frm.itemId;
|
||||
$('.ContactId', $frm).val(item.id);
|
||||
sbm.doAjaxRequest(env.ajax.refreshItem = env.ajax.refreshItem || { url: sbm.url.base + 'Contact/Ajax/GetItem', formSel: $frm, callbackFn: function (response) { co.onStoreItem(env, response); } }, 50);
|
||||
@@ -243,17 +243,19 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/* Params: type, search, fnSuccess. */
|
||||
/* Params: type, assocType, search, fnSuccess. */
|
||||
sbm.fn.selectContact = function (prm)
|
||||
{
|
||||
//sbm.debug('selectContact', prm);
|
||||
let env = co.env.select;
|
||||
if (!env.$pnl.items.length) return;
|
||||
env.prmSelect = prm;
|
||||
env.$frm.filter.find('.FilterContactType').val('');
|
||||
env.$frm.filter.find('.FilterContactType').val(prm.type || '');
|
||||
env.$frm.filter.find('.FilterSearch').val(prm.search || '');
|
||||
env.$frm.filter.find('.FilterAssocTypeExclude').val(prm.assocType || '');
|
||||
env.$pnl.table.find('tbody tr').remove();
|
||||
sbm.openDialog(env.$dlg.select, 1000, 800);
|
||||
if (env.$pnl.items.length) setTimeout(function () { co.refreshResults(env); }, 250);
|
||||
setTimeout(function () { co.refreshResults(env); }, 250);
|
||||
}
|
||||
co.selectItemRow = function (env, $item, item)
|
||||
{
|
||||
@@ -287,25 +289,26 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
co.initContactEnv = function ($pnlItems)
|
||||
co.initEnv = function ($pnlItems)
|
||||
{
|
||||
let env = { mode: { search: 1 }, data: {}, ajax: {}, $pnl: {}, $frm: {}, $ctrl: {}, $dlg: {} };
|
||||
|
||||
env.$pnl.items = $($pnlItems);
|
||||
env.$pnl.header = env.$pnl.items.find('.sbm-panel-header');
|
||||
env.$pnl.bgr = env.$pnl.header.find('.sbm-burger');
|
||||
let $items = env.$pnl.items = $($pnlItems);
|
||||
if (!$items.length) return env;
|
||||
env.$pnl.hdr = $items.find('.sbm-panel-header');
|
||||
env.$pnl.bgr = env.$pnl.hdr.find('.sbm-burger').invisible();
|
||||
env.$pnl.mnu = env.$pnl.bgr.find('ul.sbm-dropdown-menu');
|
||||
env.$pnl.table = env.$pnl.items.find('.sbm-panel-item-table');
|
||||
env.$pnl.table = $items.find('.sbm-panel-item-table');
|
||||
env.$pnl.msgs = env.$pnl.table.find('.sbm-panel-messages');
|
||||
env.$pnl.tmpls = env.$pnl.items.find('.sbm-panel-item-template');
|
||||
|
||||
env.$frm.filter = env.$pnl.items.find('.frmContactFilter');
|
||||
env.$pnl.tmpls = $items.find('.sbm-panel-item-template');
|
||||
env.$frm.filter = $items.find('.frmContactFilter');
|
||||
env.$frm.filter.on('input', '.FilterSearch', function () { co.refreshResults(env, 250); }).on('change', '.FilterContactType', function () { co.refreshResults(env, 50); });
|
||||
|
||||
var opt = sbm.dlgOpts();
|
||||
opt.dialogClass += " sbm-Contact";
|
||||
env.$dlg.item = $('#dlgContact').dialog(opt);
|
||||
env.$frm.itemId = $('#frmContactId');
|
||||
env.$frm.item = $('#frmContact').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
||||
env.$frm.item = $('#frmContact').off('input').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).off('change').on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
||||
|
||||
var opt = sbm.dlgOpts();
|
||||
opt.dialogClass += " sbm-Contact";
|
||||
@@ -319,9 +322,9 @@
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
co.env.maint = co.initContactEnv('.sbm-panel.Contacts');
|
||||
co.env.maint = co.initEnv('.sbm-panel.Contacts');
|
||||
if (co.env.maint.$pnl.items.length) setTimeout(function () { co.refreshResults(co.env.maint); }, 250);
|
||||
co.env.select = co.initContactEnv('#dlgContactSelect');
|
||||
co.env.select = co.initEnv('#dlgContactSelect');
|
||||
co.env.select.$frm.filter.find('.FilterContactType option[value="GRP"]').remove();
|
||||
if (co.env.select.$pnl.items.length) setTimeout(function () { co.refreshConfig(co.env.select); }, 250);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user