renderTemplate() {
let format = (data, container) => {
if (!data.title) return data.text;
return data.text + "<p style='color:#bbb;font-size:x-small;font-variant:small-caps'>" + data.title + "</p>";
}
return (
<div>
Template<br/>
<Select2
multiple={false}
defaultValue={2}
data={[
{ text: 'bug', id: 1, title: 'testing1' },
{ text: 'feature', id: 2, title: 'testing2' },
{ text: 'documents', id: 3, title: 'testing3' },
{ text: 'discussion', id: 4, title: 'testing4' }
]}
options={{
placeholder: 'search by tags',
templateResult: format
}}
/>
</div>
);
}
also tried this like the select2 example shows but that didn't work either.
return $(data.text + "<p style='color:#bbb;font-size:x-small;font-variant:small-caps'>" + data.title + "</p>");