@@ -54,41 +54,45 @@ before custom option, you should known what adminlte has used.
5454
5555### AdminlteSelect
5656
57+ > Since v1.5.0b0, you don't need modify new template to active select2.
58+
5759example:
5860```
5961# adminlte/admin.py
6062@admin.register(Menu)
6163class MenuAdmin(TreeAdmin):
6264 ...
63- change_form_template = 'adminlte/menu_change_form.html'
65+ # change_form_template = 'adminlte/menu_change_form.html'
6466 formfield_overrides = {
6567 models.ForeignKey: {'widget': AdminlteSelect}
6668 }
6769
6870# adminlte/menu_change_form.html
6971# active the target select
70- {% extends 'admin/change_form.html' %}
71-
72- {% block extrajs %}
73- {{ block.super }}
74- <script>
75- django.jQuery('#id_content_type').select2();
76- </script>
77- {% endblock %}
72+ # {% extends 'admin/change_form.html' %}
73+
74+ # {% block extrajs %}
75+ # {{ block.super }}
76+ # <script>
77+ # django.jQuery('#id_content_type').select2();
78+ # </script>
79+ # {% endblock %}
7880```
7981effect:
8082
8183![ adminlte_select] ( https://github.com/wuyue92tree/django-adminlte-ui/blob/master/images/adminlte_select.png?raw=true )
8284
8385### AdminlteSelectMultiple
8486
87+ > Since v1.5.0b0, you don't need modify new template to active select2.
88+
8589example:
8690```
8791# adminlte/admin.py
8892@admin.register(Menu)
8993class MenuAdmin(TreeAdmin):
9094 ...
91- change_form_template = 'adminlte/menu_change_form.html'
95+ # change_form_template = 'adminlte/menu_change_form.html'
9296 formfield_overrides = {
9397 # multiple for ManayToManyField
9498 models.ManayToManyField: {'widget': AdminlteSelectMultiple(
@@ -98,14 +102,14 @@ class MenuAdmin(TreeAdmin):
98102
99103# adminlte/menu_change_form.html
100104# active the target select
101- {% extends 'admin/change_form.html' %}
102-
103- {% block extrajs %}
104- {{ block.super }}
105- <script>
106- django.jQuery('#id_content_type').select2();
107- </script>
108- {% endblock %}
105+ # {% extends 'admin/change_form.html' %}
106+
107+ # {% block extrajs %}
108+ # {{ block.super }}
109+ # <script>
110+ # django.jQuery('#id_content_type').select2();
111+ # </script>
112+ # {% endblock %}
109113```
110114effect:
111115
0 commit comments