Ext.onReady(function () {
var usertabs = Ext.getCmp('modx-user-tabs');
usertabs.add({
title: 'Phybridge Portal',
defaults: { labelWidth: 180 },
layout: 'form',
autoScroll: true,
autoHeight: false,
labelAlign: "left",
labelWidth: 180,
width: 800,
height: 500,
cls: 'main-wrapper',
items: [
{
html: '<p style="margin-bottom:10px;">Select which Phybridge staff member is to be this person\'s assigned Sales Manager.</p>'
, border: false
, bodyCssClass: 'panel-desc2'
}
, {
fieldLabel: 'Assigned staff',
id: 'my-stafflist-sales-manager',
name: 'mystafflist[]',
xtype: 'my-stafflist',
resizable: true
, value: (smsaved > 0) ? smsaved : ''
}
]
});
});
MODx.combo.stafflist = function (config) {
config = config || {};
Ext.applyIf(config, {
name: 'stafflist'
, hiddenName: 'stafflist'
, displayField: 'fullname'
, valueField: 'id'
, typeAhead: true
, selectOnFocus:true
, editable: false
, fields: ['fullname', 'id']
, pageSize: 20
, width: 300
//,value: config.record.con_id || ''
, emptyText: _('empty text')
, store: new Ext.data.JsonStore({
id: 'id',
autoLoad: true,
root: 'results',
dir: 'ASC',
fields: ['fullname', 'id'],
url: MODx.config.connectors_url + 'security/user.php',
baseParams: {
action: 'getList'
, usergroup: 7
, sort: 'fullname'
, dir: 'ASC'
}
})
});
MODx.combo.stafflist.superclass.constructor.call(this, config);
};
Ext.extend(MODx.combo.stafflist, MODx.combo.ComboBox);
Ext.reg('my-stafflist', MODx.combo.stafflist);
Many thanks in advance!This question has been answered by peelay. See the first response.
Ext.onReady(function () { var usertabs = Ext.getCmp('modx-user-tabs'); usertabs.add({ title: 'Phybridge Portal', defaults: { labelWidth: 180 }, layout: 'form', autoScroll: true, autoHeight: false, labelAlign: "left", labelWidth: 180, width: 800, height: 500, cls: 'main-wrapper', items: [ { html: '<p style="margin-bottom:10px;">Select which Phybridge staff member is to be this person\'s assigned Sales Manager.</p>' , border: false , bodyCssClass: 'panel-desc2' } , { fieldLabel: 'Assigned staff', id: 'my-stafflist-sales-manager', name: 'mystafflist[]', xtype: 'my-stafflist', resizable: true , value: (smsaved > 0) ? smsaved : '' , listeners: { 'select': { fn: function (data) { Ext.getCmp('modx-panel-user').markDirty(); } } } } ] }); });
After a whole lot of digging and trial and error and in the end searching all the source .js files to find something similar I finally found the solution. Needed to add listener (which I already was pretty sure of) but also found out that you need to mark the user panel (not tab) as dirty to get the Save button active. Would be amazing if this could be documented somewhere, perhaps as part of Adding Custom Extension, if it is documented already please point the way! I'm sure there's more info I could learn there.