Ich benutze Select2 js-Bibliothek, aber ich kann nicht die Links in die Auswahloptionen setzen. Hier ist meine Json StrukturSelect2 gehe zu href link
[{id: 1, title: "Foo", slug: "foo"}]
Und mein select2 Skript
$(".search-box").select2({
placeholder: "Enter...",
ajax: {
url: window.location.href + '/search',
dataType: 'json',
delay: 250,
data: function (params) {
return {
q: params.term // search term
};
},
processResults: function (data) {
// parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to
// alter the remote JSON data
return {
results: $.map(data, function (item) {
return {
text: item.title,
id: item.id
}
})
};
},
cache: true
},
minimumInputLength: 2,
maximumSelectionLength: 6
});
Was ich erwarte, ist, wenn ich den Titel SELECT OPTION ein und klicken Sie i der Browser auf die Post die Adresse (Link) gehen möchten
So jede mögliche Hilfe plzzz
Aber ... ich habe es benutzt und es hat gut funktioniert, und das Problem ist nicht online "url: window.location.href + '/ search'," –