how to show "add button" if no results found?
zachross25 opened this issue · 4 comments
zachross25 commented
subject
zachross25 commented
i found in source params and set to js_options
'formatNoMatches': 'function () { return "ss"; }'
in console i see error Uncaught Error: formatNoMatches must be a function or a falsy value
which format of formatNoMatches value must be?
zachross25 commented
i put function get_not_found_block(){} to page head
and try set
'formatNoMatches': 'get_not_found_block()'
or
'formatNoMatches': 'get_not_found_block'
stay same error
zachross25 commented
up
fdintino commented
It is not possible to have javascript code in the select2 options passed in via django. If you need this functionality your best bet is to add your own script that overrides $.fn.select2.defaults