I'm using select2
and I want to set a custom field for the text
property of the rendered items without
- replacing standard behavior (marking and such)
- pushin all my array into a new one with the text field on it
- ps: i just want to a render many select2 items that doesn't have a
text
field
- ps: i just want to a render many select2 items that doesn't have a
Basically if you see this jsbin you will see something like this
$("#e10_3").select2({
data:{ results: data, text: function(item) { return item.tag; } },
formatSelection: format,
formatResult: format
});
But if I delete the custom formatSelection and formatResult parameters of select2 I loose my hability to use a different field for text
.