Results for grouped options (see #4662)
This commit is contained in:
parent
787d20ef0c
commit
0459ac89f5
@ -32,11 +32,11 @@
|
|||||||
{
|
{
|
||||||
"results": [
|
"results": [
|
||||||
{
|
{
|
||||||
"id": "1",
|
"id": 1,
|
||||||
"text": "Option 1"
|
"text": "Option 1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2",
|
"id": 2,
|
||||||
"text": "Option 2"
|
"text": "Option 2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -44,6 +44,47 @@
|
|||||||
"more": true
|
"more": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
<h4>Results for grouped options</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
When options are to be generated in <code><optgroup></code> sections, options should be nested under the <code>children</code> attribute of each group object:
|
||||||
|
|
||||||
|
{% highlight json linenos %}
|
||||||
|
{
|
||||||
|
"results": [
|
||||||
|
{
|
||||||
|
"text": "Group 1",
|
||||||
|
"children" : [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"text": "Option 1.1"
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"text": "Option 1.2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "Group 2",
|
||||||
|
"children" : [
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"text": "Option 2.1"
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"text": "Option 2.2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paginate": {
|
||||||
|
"more": true
|
||||||
|
}
|
||||||
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user