[pve-devel] combo box help

Dietmar Maurer dietmar at proxmox.com
Wed Jul 13 08:10:40 CEST 2011


Hi Seth,

> groupsgroupsGET https://192.168.1.106:8006/api2/json/access/groups?query=
> 400 (Paramter verification failed.)

The proxmox API server return detailed information about parameter verification errors (thanks to JSON Schema). You just need to look at the http response:

> {"errors":{"query":"property is not defined in schema and the schema does not allow additional properties"},"data":null}

This tell you that you sent a parameter called 'query' in your request (you can easily verify that by looking at the request header:

> Request URL:https://maui:8006/api2/json/access/groups?query=

As you see that url is not what you want. 

In fact this is due to an incompatible ExtJS change - the ComboBox renamed 'mode' to 'queryMode'.

So you need to replace:

               mode: 'local',


with:

	queryMode: 'local',

I also use the 'pve-groups' model instead of 'combo-groups' (whatever that is), and set autoLoad to true:

            new Ext.form.ComboBox({
                fieldLabel: 'Group',
                hiddenName: 'groupid',
                store: new Ext.data.Store({
		    autoLoad: true,
                    model: 'pve-groups',
                    proxy: {
                        type: 'pve',
                        url: "/api2/json/access/groups"
                    },
                    sorters: {
                        property: 'groupid',
                        order: 'DESC'
                    }
                }),
                valueField: 'groupid',
                displayField: 'groupid',
                typeAhead: true,
                queryMode: 'local',
                triggerAction: 'all',
                emptyText: 'No Groups Selected',
                selectOnFocus: true
            })

- Dietmar



More information about the pve-devel mailing list