[12,15]
А вот после обновления страницы сохраненные данные в поле не подставляются. Поле добавляю через систему плагинов расширения miniShop2.
Не могу заставить тут код нормально отформатироваться(((
xtype:
miniShop2.combo.InShop = function (config) {
config = config || {};
Ext.applyIf(config, {
xtype: 'superboxselect',
allowBlank: true,
msgTarget: 'under',
allowAddNewData: false,
addNewDataOnBlur: true,
pinList: false,
resizable: true,
name: config.name,
anchor: '100%',
minChars: 0,
store: new Ext.data.JsonStore({
id: config.name+'-store',
root: 'results',
autoLoad: false,
autoSave: false,
totalProperty: 'total',
fields: ['pagetitle', 'id'],
url: '/assets/components/cov/connector.php',
baseParams: {
action: 'mgr/shops/getlist',
combo: true,
parent: config.parent
}
}),
mode: 'remote',
displayField: 'pagetitle',
valueField: 'id',
triggerAction: 'all',
extraItemCls: 'x-tag',
expandBtnCls: 'x-form-trigger',
clearBtnCls: 'x-form-trigger'
});
config.name += '[]';
miniShop2.combo.InShop.superclass.constructor.call(this, config);
};
Ext.extend(miniShop2.combo.InShop, Ext.ux.form.SuperBoxSelect);
Ext.reg('minishop2-combo-inshop', miniShop2.combo.InShop);
Процессор:
class msPluginGetListProcessor extends modObjectGetListProcessor
{
public $classKey = 'modResource';
public $defaultSortField = 'id';
public $defaultSortDirection = 'ASC';
public $fromRes = 33173;
/**
* @return bool|null|string
*/
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
if (!empty($this->getProperty('parent'))) {
$this->fromRes = $this->getProperty('parent');
}
return parent::initialize();
}
/**
* Can be used to adjust the query prior to the COUNT statement
*
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c) {
$c->where(array(
'parent' => $this->fromRes
));
return $c;
}
/**
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$data = array();
if ($this->getProperty('combo')) {
$data = array(
'id' => $object->get('id'),
'pagetitle' => $object->get('pagetitle'),
);
} else {}
return $data;
}
}
return 'msPluginGetListProcessor';
Комментарии (0)