mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-29 02:40:19 +02:00
Add custom property tests
This commit is contained in:
parent
61f02034a7
commit
897745fcba
|
@ -166,6 +166,11 @@
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-test-hook="custom-properties">
|
||||||
|
<label for="choices-custom-properties">Custom properties</label>
|
||||||
|
<select class="form-control" name="choices-custom-properties" id="choices-custom-properties" multiple></select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
@ -225,6 +230,36 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
new Choices('#choices-groups');
|
new Choices('#choices-groups');
|
||||||
|
|
||||||
|
new Choices('#choices-custom-properties', {
|
||||||
|
searchFields: ['label', 'value', 'customProperties.country'],
|
||||||
|
choices: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: 'London',
|
||||||
|
label: 'London',
|
||||||
|
customProperties: {
|
||||||
|
country: 'United Kingdom',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: 'Berlin',
|
||||||
|
label: 'Berlin',
|
||||||
|
customProperties: {
|
||||||
|
country: 'Germany',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: 'Lisbon',
|
||||||
|
label: 'Lisbon',
|
||||||
|
customProperties: {
|
||||||
|
country: 'Portugal',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -170,6 +170,11 @@
|
||||||
<option value="Child choice 3">Child choice 3</option>
|
<option value="Child choice 3">Child choice 3</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-test-hook="custom-properties">
|
||||||
|
<label for="choices-custom-properties">Custom properties</label>
|
||||||
|
<select class="form-control" name="choices-custom-properties" id="choices-custom-properties"></select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
@ -237,6 +242,36 @@
|
||||||
child.disable();
|
child.disable();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
new Choices('#choices-custom-properties', {
|
||||||
|
searchFields: ['label', 'value', 'customProperties.country'],
|
||||||
|
choices: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
value: 'London',
|
||||||
|
label: 'London',
|
||||||
|
customProperties: {
|
||||||
|
country: 'United Kingdom',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
value: 'Berlin',
|
||||||
|
label: 'Berlin',
|
||||||
|
customProperties: {
|
||||||
|
country: 'Germany',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: 'Lisbon',
|
||||||
|
label: 'Lisbon',
|
||||||
|
customProperties: {
|
||||||
|
country: 'Portugal',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue