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

Django add new popup window not working if nested #310

Open
kalevhark opened this issue Dec 19, 2023 · 1 comment
Open

Django add new popup window not working if nested #310

kalevhark opened this issue Dec 19, 2023 · 1 comment

Comments

@kalevhark
Copy link

kalevhark commented Dec 19, 2023

Tested new v3.0.1 in Django admin but it's don't work correctly in the case of nested popups.

Steps I did:

  1. in ajax-select-multiple widget selected "add new" item
  2. opened new item popup window
  3. in new popup window select "add new" item, I fiiled data and saved
  4. popup 2 closes but in popup 1 nothing happens.

I propose problem is ajax-select.js code in line 244:
var input = $("#" + win.name.replace("__1", ""));
I changed to:
var input = $("#" + win.name.split("__")[0]);
And in my case it's now works.

Problem seems to be in enumerating of popups - every popup has unique number in the end "__1", "__2" etc.

@kalevhark kalevhark changed the title Hardcoded Django add new popup window not working if nested Django add new popup window not working if nested Dec 19, 2023
@crucialfelix
Copy link
Owner

Yes, applying hacks like this is always going to run into problems. Django isn't intending that plugins hack their system to extend functionality.

I will test it with removing all the __N, but I think it's going to cause more problems.

Thanks very much for reporting!

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

2 participants