Open mittus opened 6 years ago
I don't understand, could you please describe it better or give more information? Thank you
&bpsp;
, it have not problem)
Ah yes that I know, unfortunately it is so for the moment, because it trims the spaces when entering the value in the item editor. Can you use
or is there a problem?
Yes, with
I can and it is not problem.
Hello!! How I can use multiple dropdown for select several values?
Hi mittus!
Unfortunately, we currently have no way to accomplish this. You can use a chunk field or write your own field type that allows it.
With a chunk field it should be relatively easy, for example:
cars
. Give this field area CSS class hidden
.<div class="fieldarea">
<label for="multiple_dropdown">Select Multiple</label>
<div class="field-wrapper">
<select id="selectMultiple" multiple>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
</div>
</div>
<script>
$(function() {
var values = $("#cars").val();
$.each(values.split(","), function(i,e){
$("select#selectMultiple option[value='" + e + "']").prop("selected", true);
});
$("select#selectMultiple").change(function(e) {
var selected = $(e.target).val();
$("#cars").val(selected);
console.log($("#cars").val())
});
});
</script>
Sometime I will extend ItemManager with the new field, unfortunately I don't have time for it now ;-)
Hello!
I need use my own field. Now trying create multiple field. If you have example, give me please.
Thank You!!
Here are the files you can duplicate and customize:
imanager/lib/processors/fields/FieldDropdown.php
imanager/lib/processors/inputs/InputDropdown.php
Since these fields also implement InputText
, take a look at the imanager/lib/processors/inputs/InputText.php
file.
And you still have to adjust your backend template file /plugins/imanager/tpl/row.fields.im.tpl
.
You can also find more information here: https://ehret-studio.com/articles/itemmanager/itemmanager-fieldtypes/
Good luck! ;-)
If I save empty values with spase (not a
), in the items, when I try save them, I see error "Invalid value format for the Fieldtype"