Skip to content
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

Advanced filter popup not opening with django-grappelli installed #49

Closed
lazygalminion opened this issue May 29, 2017 · 10 comments
Closed

Comments

@lazygalminion
Copy link

Hi, I have installed django-grappelli followed by django-advanced-filters. Although I see the "Advanced Filters" button, it does not open a popup on clicking it. would be of great help if someone can help me with this.
Thanks

@Zax337
Copy link

Zax337 commented Aug 22, 2017

Hey, can't really help, but I've got the same problem here.

@asfaltboy
Copy link
Member

Hi, my apologies for delay in response, I must have missed this issue.
Can either of you revert with your version of Django/Python and which version of django-advanced-filters you are using?

I have a feeling you're on Django > 1.10 and experiencing issue #48. You can try and install the develop branch directly to test out the solution.

@Zax337
Copy link

Zax337 commented Aug 22, 2017

Hi, thanks for the fast (at least for me 😄 ) answer.
I'm using python 3.5.2 with Django 1.11.4 (so indeed, > 1.10) and django-advanced-filters version 1.0.5.
I just tried the develop branch but it doesn't seem to fix it. = /

The main error I can see is TypeError: $ is not a function in advanced-filters.js:147:2 which refers to:

// using Grappelli's jquery if available
(function($) {
	$(document).ready(function() {
		if (!_af_handlers) {
			_af_handlers = new OperatorHandlers($);
			_af_handlers.destroy()
			_af_handlers.init();
		}
	});
})(window._jq || jQuery);

I have no clue how I can help you best so don't hesitate to ask me for more details.

asfaltboy added a commit to asfaltboy/django-advanced-filters that referenced this issue Aug 22, 2017
Adds jQuery to global vars (window.jQuery) if it was removed by
Grappelli, since other packages expect it to be there.

Related to modlinltd#49
@asfaltboy
Copy link
Member

Thanks @Zax337 , can you please try the branch feature/grappelli-add-jquery-global? It seems grappelli remove the global jQuery variable, which breaks loading for magnific-popup and select2 packages, both of which we use.

@Zax337
Copy link

Zax337 commented Aug 22, 2017

Thanks a lot @asfaltboy, it indeed fixes the issue!

@Zax337
Copy link

Zax337 commented Aug 29, 2017

Hey,

Do you have an ETA of when this fix will reach master?
Thanks!

@asfaltboy
Copy link
Member

@Zax337 sure we can probably release by this weekend

@Zax337
Copy link

Zax337 commented Aug 30, 2017

Perfect, thanks again!

@asfaltboy
Copy link
Member

@Zax337 just to update, release 1.0.6 has happened! 🎉

@Zax337
Copy link

Zax337 commented Sep 5, 2017

Yay, I've seen that, thanks again! 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants