<p>I'm displaying a Users field within a template within a CP plugin, but when editing the entry, only Users that are active are being shown. Here is my field:</p>

<pre><code>{{ forms.elementSelect({
    id: 'schoolteacher',
    name: 'fields[schoolTeacher]',
    elementType: craft.elements.getElementType("User"),
    elements: school.schoolTeacher | default,
    criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb"},
    jsClass: 'Craft.AssetSelectInput',
    addButtonLabel: 'Select school teacher',
    sources: ['group:2']
}) }}
</code></pre>

<p>Viewing the exact same Users field within the standard CP entries section, all users are displayed irresepective of status. I think what I need to do is amend my field to allow usrs with the Pending status to be displayed. I've tried the following, but it makes no difference:</p>

<pre><code>criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": "active, pending"},
criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": "Pending"},
criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": null},
</code></pre>

<p>Looking through the app, I think status: null should return all of users of any status. Any ideas anyone?</p>

CC BY-SA 3.0
2016-07-22T17:39:34.717Z
Off the top of my head, I would guess that would work. You have xDebug installed? Seems like a great case for it.
Brad Bell
CC BY-SA 3.0
2016-07-27T09:44:52.410Z
Which one are you guessing would work?
Clive Portman
CC BY-SA 3.0
2016-07-27T16:52:21.810Z
I would guess `"status": null` would work.
Brad Bell
<plugin-development><users><control-panel>
Displaying Pending users within CP users field (in plugin template)
# Displaying Pending users within CP users field (in plugin template)

(Asked by: username_0 on 2016-07-22)

I'm displaying a Users field within a template within a CP plugin, but when editing the entry, only Users that are active are being shown. Here is my field:
{{ forms.elementSelect({
    id: 'schoolteacher',
    name: 'fields[schoolTeacher]',
    elementType: craft.elements.getElementType("User"),
    elements: school.schoolTeacher | default,
    criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb"},
    jsClass: 'Craft.AssetSelectInput',
    addButtonLabel: 'Select school teacher',
    sources: ['group:2']
}) }}

Viewing the exact same Users field within the standard CP entries section, all users are displayed irresepective of status. I think what I need to do is amend my field to allow usrs with the Pending status to be displayed. I've tried the following, but it makes no difference:
criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": "active, pending"},
criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": "Pending"},
criteria: {"kind":[],"localeEnabled":null,"locale":"en_gb", "status": null},

Looking through the app, I think status: null should return all of users of any status. Any ideas anyone?

**Tags:** plugin-development, users, control-panel

> **Comments:**
> **username_1**: Off the top of my head, I would guess that would work. You have xDebug installed? Seems like a great case for it.  
> **username_0**: Which one are you guessing would work?  
> **username_1**: I would guess `"status": null` would work.  

---

## 0 answers

