This is a migrated thread and some comments may be shown as answers.

Cascading DropDownList with n:n relation

2 Answers 37 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Tayger
Top achievements
Rank 1
Iron
Tayger asked on 17 Oct 2015, 09:07 PM

Hello there

I'm working with 2 DropDownLists, parent and child. It works fine so far with cascading . Then I realized the relation from parent to child is always 1:n. Is there a (easy) way to make it n:n? An example based on data source:

Parent:

      dataSource: [
        { actionText: "​​Drive", actionId: 1 },
        { actionText: "​Open", actionId: 2 }
      ] 

 Child: 

      dataSource: [
        { objectText: "Car", objectId: 1, actionId: 1 },
        { objectText: "Window", objectId: 2, actionId: 2 }
 ]

This gives the following (cascading) relations: 

Drive   -> Car
Open   -> Window

But a car can be opened (its doors)  as well, so the following cascading relations are wanted:
Drive -> Car
Open -> Car
           -> Window

That means I need to define two relations from child "Car" to parent (to "Drive" AND "Open"). So when "Open" is chosen from parent DropdownList the child DropdownList should have listed "Window" AND "Car" do be chosen. 

Is there a (easy) way to define this? As a workaround I see a reconfiguration of the child dataSource after selecting an item from the parent DropdownList.

Regards

    

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 21 Oct 2015, 08:27 AM
Hello Tayger,

Indeed, the built-in cascading functionality expects the relation between parent and child to be 1:n. The only way to accomplish cascading n:m is to implement the filtering behavior manually. That being said, you will need a custom solution instead of the cascading feature.

Note that custom solutions fall out of the scope of the standard support service.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tayger
Top achievements
Rank 1
Iron
answered on 26 Oct 2015, 03:46 PM
Thank you for your confirmation. So I will change the datasource on cascading dropdownlist.
Tags
DropDownList
Asked by
Tayger
Top achievements
Rank 1
Iron
Answers by
Georgi Krustev
Telerik team
Tayger
Top achievements
Rank 1
Iron
Share this question
or