Flexmail.combo.sourceDocs = function(config){
config = config || {};
Ext.applyIf(config,{
valueField: 'id',
displayField: 'pagetitle',
fields: ['id','pagetitle','year','pubname'],
url: Flexmail.config.connectorUrl,
baseParams: { action: 'mgr/campaigns/sourcedocsflat' },
tpl: new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">{pagetitle} ({id})</div></tpl>')
});
Flexmail.combo.sourceDocs.superclass.constructor.call(this,config);
};
Ext.extend(Flexmail.combo.sourceDocs,MODx.combo.ComboBox);
Ext.reg('flexmail-combo-sourcedocs',Flexmail.combo.sourceDocs);
This question has been answered by markh. See the first response.
So, that's going to look for a sourcedocsflat file to return values to fill the form field. First question on that: Does sourcedocsflat need to be a class (in sourcedocsflat.class.php) extending on of ModX's classes, or can it be a straight php file (sourcedocsflat.php). On the former, what class would I need to extend to gain access to resource data? In either case, what would the modx object be available as ($this, $this->modx, $modx, something else)?
class SourceDocsFlatGetlistProcessor extends modObjectGetListProcessor {
public $classKey = 'modResource';
public $defaultSortField = 'pagetitle';
public $defaultSortDirection = 'ASC';
/**
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c) {
$c->where(array(
'parent' => 5,
));
return $c;
}
}
return 'SourceDocsFlatGetlistProcessor'; baseParams: { action: 'mgr/campaigns/sourcedocsflat' }, baseParams: { action: 'mgr/campaigns/sourcedocsflat', combo: true },public function prepareQueryBeforeCount(xPDOQuery $c) {
$c->where(array(
'parent' => 5,
}
return $c;
}public function prepareQueryBeforeCount(xPDOQuery $c) {
$c->where(array(
'parent' => 5,
));
return $c;
}