


Ext.extend(Salonus.window.Service, MODx.Window, {
getKeys: function() {
return [{
key: Ext.EventObject.ENTER,
shift: true,
fn: this.submit,
scope: this
}];
},
getFields: function() {
return [{
xtype: 'hidden',
name: 'id'
}, {
layout: 'column',
border: false,
items: [{
columnWidth: 0.5,
border: false,
layout: 'form',
items: [
{html: _('salonus_description')},
{xtype: 'textfield', fieldLabel: _('salonus_service_name'), description: _('salonus_service_name'), name: 'name', anchor: '100%', allowBlank:false},
{xtype: 'numberfield', fieldLabel: _('salonus_service_price'), name: 'price', anchor: '100%', allowBlank:false},
{xtype: 'salonus-combo-specialties', fieldLabel: _('salonus_service_specialty'), name: 'specialties', anchor: '100%', allowBlank: false, resizable: true, renderTo: Ext.getBody()},
{xtype: 'xcheckbox', fieldLabel: _('salonus_service_fix_price'), name: 'fixed', anchor: '100%'},
{xtype: 'numberfield', fieldLabel: _('salonus_service_fix_rate'), name: 'fix_rate', anchor: '100%'},
{xtype: 'numberfield', fieldLabel: _('salonus_service_rate'), name: 'rate', anchor: '100%'}
]
},{
columnWidth: 0.5,
border: false,
layout: 'form',
items: [
{html: _('salonus_consumable')},
{xtype: 'xcheckbox', fieldLabel: _('salonus_service_used_material'), name: 'has_product', anchor: '100%'},
{xtype: 'salonus-combo-products2', fieldLabel: _('salonus_materials'), name: 'products', anchor: '100%', resizable: true ,renderTo: Ext.getBody()}
]
}]
}];
}
});
Ext.reg('xr-window-service', Salonus.window.Service);
Salonus.combo.Specialties = function (config) {
config = config || {};
Ext.applyIf(config, {
xtype: 'superboxselect',
allowBlank: true,
msgTarget: 'under',
allowAddNewData: true,
addNewDataOnBlur: true,
pinList: false,
resizable: true,
name: config.name + '[]',
anchor: '100%',
minChars: 1,
store: new Ext.data.JsonStore({
id: config.name + '-store',
root: 'results',
autoLoad: true,
autoSave: false,
totalProperty: 'total',
fields: ['id','title'],
url: Salonus.config['connector_url'],
baseParams: {
action: 'mgr/services/getspecialties',
salon_id: MODx.request.id,
service_id: Salonus.config.row ? Salonus.config.row.id : '0'
}
}),
mode: 'remote',
displayField: 'title',
valueField: 'id',
triggerAction: 'all',
extraItemCls: 'x-tag',
expandBtnCls: 'x-form-trigger',
clearBtnCls: 'x-form-trigger',
});
config.name += '[]';
Salonus.combo.Specialties.superclass.constructor.call(this, config);
};
Ext.extend(Salonus.combo.Specialties, Ext.ux.form.SuperBoxSelect);
This question has been answered by bakimenko. See the first response.
value:'{$values}',dataIndex: