New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[select2 4.0.0-beta3] Display a link to add a new item if no results are found #3008
Comments
I've updated the code to allow for HTML to be passed back from the language options, but keep in mind that it is passed through You can get around this by building it out as a jQuery object and passing that back, or by overriding |
Awesome, thanks for quick response! |
Hey , |
@JayatiTehri use language->noResults and escapeMarkup options to customice the no result text. ;-)
|
Where can I found documentation about those functions? I didn't find anything in the main website. |
The general docu for Select2 can be found here. The code I provided is just a "workaround". It is a combination of a customized "No results" text and the overridden |
Its any workaround to provide a link to add a new item on the top of the results? I need a fixed option so its always available to the user, but I couldn't figure out how to do it. Im using a custom dataAdapter to set some records when the user open the select. The workaround proposed here its a nice option, but it not work at all for me. |
still not working .. can't get the term entered to use in the formatting of the text |
|
@icrm-amusienko : Please open a new issue. This issue has been closed a year ago... |
@icrm-amusienko this is how i showing term
|
In previous versions, the formatNoMatches option could be used to provide a link to add a new item if no matches were found:
However when trying to replicate this using 4.0-beta3's new languages.noResults function:
the raw unformatted string appears in the dropdown, rather than a link. Manually creating a DOM object in the function and returning that also doesn't work, though I wouldn't really expect it to. Is there another way to achieve this functionality in 4.0? Thanks.
The text was updated successfully, but these errors were encountered: