Answer the question
In order to leave comments, you need to log in
How to display a list of resources on modx (extJs) in combo?
Hello, the task is to get and display a list of resources in a combo box (extjs) I
took the Doodle plugin as a basis,
I can’t understand how routes work here?
Now the code looks like this:
Doodles.window.CreateDoodle = function(config) {
config = config || {};
Ext.applyIf(config,{
title: _('doodles.doodle_create')
,url: Doodles.config.connectorUrl
,baseParams: {
action: 'mgr/doodle/create'
}
,fields: [
{
xtype: 'textfield'
,fieldLabel: _('doodles.name')
,name: 'name'
,width: 300
},{
xtype: 'textarea'
,fieldLabel: _('doodles.description')
,name: 'description'
,width: 300
},
{
xtype: 'combo'
,fieldLabel: 'test'
,name: 'test'
,hiddenName: 'ffds'
,baseParams:{
action: 'mgr/resources/getList'
}
},{
xtype:'combo',
fieldLabel:'Title',
name:'division',
queryMode:'local',
store:['Mr','Mrs','Ms'],
width: 300,
autoSelect:true,
forceSelection:true
}]
});
Doodles.window.CreateDoodle.superclass.constructor.call(this,config);
};
Answer the question
In order to leave comments, you need to log in
After an hour of scientific poke, I got a working code :)
xtype: 'modx-combo',
fieldLabel: _('teaching_res_title'),
name: 'resource_id',
displayField: 'pagetitle',
hiddenName: 'resource_id',
valueField: 'id',
fields: ['pagetitle','id'],
pageSize: 20,
url: MODx.config.connector_url,
baseParams:{
action: 'resource/getlist'
},
typeAhead: true,
editable: true,
anchor: '99%',
},{
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question