ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Cascade Lookup with CRUD
Title:
B
I
{code}
?
I'd like to 'tie' two lookup controls with crud so that they have a parent- child cascade. But would like some guidance/ advice before getting started from the demos provided. What's optimal would be like the Country Selector in the Pro Dinner Demo, but in an imaginary world game -- so that users can create or select a country and in a separate control create or select a region ( and possibly in a third) create or select cities. Of course if a new country is created it will not have counties or cities ... so those fields will not be required, but the null should be handled with a default value. Or even if the lists are global where all regions and cities are listed that might work. Handling of multiple entities is desired to give the UX a 'one-page-app' feel.
Save Changes
Cancel
Stephan Luis
asked at 04 Aug 2017
start with 3 lookups, bind them using `.Parent`, and after you can try to add the crud
at 04 Aug 2017
Omu
How likely is that to work, have you seen your code used like that?
at 04 Aug 2017
Stephan Luis
http://demo.aspnetawesome.com/LookupDemo/Misc#Lookup-bound-to-many-parents
at 04 Aug 2017
Omu
I did see those ... was asking more about the likelihood of the CRUD working with those?? By the way the first parent control (with multi-select) in that demo doesn't trigger a filter on the child, seems like it's supposed to?
at 04 Aug 2017
Stephan Luis
it will work; the lookups will not clear the value if the parent changes, but if you open the lookup popup, you'll notice the available items are filtered accordingly; you can clear the value of the child manually if you need it to, just call `$('#parent').change(function(){ $('#child').val('').change(); });`
at 04 Aug 2017
Omu
Ok, they work in combination. That's not clear from how it's set up ... looks like they're independent. 1 Parent and 2 Parent might be better labels. Thanks for the help and the tip to jQ a clear of the child. Will try to set up those CRUDS.
at 04 Aug 2017
Stephan Luis
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK