Cascading dropdown boxes #13408
Unanswered
bkampsnl
asked this question in
Help Wanted!
Replies: 1 comment
-
Any traction on this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm writing a plugin that should use cascading dropdown lists (dependend on each other). I have noticed that this is not something that is default supported by Netbox.
I see that for example that the relation between dropdownboxes (for examples site and location) are not really enforced in the UI but instead the selected values are checked at the backend.
For example : I select a site and then a location of that site (of a device). Then I select another site but the location of the previous selected site is still selected in the location dropdown. So I guess dropdown I want the dropdown boxes to be cleared that are related on the dropdown box that was just changed.
I noticed that there is no jquery in Netbox so I guess I have to use plain old javascript. I hope there is a better way or the following steps (that I have followed until now) are the best option I have :
Change the view to load the new html file :
Change the form so the children dropdown boxes have no selected values :
Now at this point I have to a view that will return the devices that are for that platform. And also load the devices using ajax / plain old javascript...
I wonder: is there an easier way ?
Beta Was this translation helpful? Give feedback.
All reactions