mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-05-13 23:53:10 +00:00
define hashedSelector in Select2Mixin
This commit is contained in:
parent
28e8b54425
commit
12b00c1084
1 changed files with 3 additions and 2 deletions
|
|
@ -184,8 +184,9 @@ class Select2Mixin(object):
|
|||
"""
|
||||
options = json.dumps(self.get_options())
|
||||
options = options.replace('"*START*', '').replace('*END*"', '')
|
||||
# selector variable must already be passed to this
|
||||
return '$(hashedSelector).select2(%s);' % (options)
|
||||
js = 'var hashedSelector = "#" + "%s";' % id_
|
||||
js += '$(hashedSelector).select2(%s);' % (options)
|
||||
return js
|
||||
|
||||
def render(self, name, value, attrs=None, choices=()):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue