J
J
Justique2016-11-21 22:28:51
MODX
Justique, 2016-11-21 22:28:51

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);
};

I don't understand how to debug what comes from action: 'mgr/resources/getList' (Network is empty).
Maybe someone has an operating time of a component with the output of resources in a combobox?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
touol, 2018-08-26
@touol

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%',
        },{

A
Andrej Kopp, 2018-11-01
@sequelone

Here the modExtra component is taken as a basis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question