django - resizing horizontal filter for group admin page -
i'm trying resize horitontal filter default group admin page because small. here i've tried: admin.py:
class groupadmin(admin.modeladmin): filter_horizontal = ('permissions',) class media: js = ('js/group_admin.js',) admin.site.unregister(group) admin.site.register(group, groupadmin)
group_admin.js:
$(function() { $("#id_permissions_from").css("height", 600); $("#id_permissions_from").css("overflow", "scroll"); $("#id_permissions_to").css("height", 600); $("#id_permissions_to").css("overflow", "scroll"); })
it's not resizing , not showing javascript error. if run javascript above in console works fine; there must wrong order of javascripts getting loaded. i'm using django 1.8. ideas?
you can .js or .css also.
try js:
$(document).ready(function(){ $("#id_permissions_from").css("height", 600); $("#id_permissions_from").css("overflow", "scroll"); $("#id_permissions_to").css("height", 600); $("#id_permissions_to").css("overflow", "scroll"); })
or .css, have add css class media
#id_permissions_from{ "height": 600; "overflow": "scroll"; } #id_permissions_to{ "height": 600; "overflow": "scroll" }
and class in admin should this
class media: js = ('js/admin/my_own_admin.js',) css = { 'all': ('css/admin/my_own_admin.css',) }
Comments
Post a Comment