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

Cascading Dropdown enabled when Parent not Selected

1 Answer 556 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 29 Sep 2014, 07:51 AM
Hi,

I'm trying to create a cascading drop down list where the child (Order) is still enabled when the parent (Customer) has not been selected, as non selection means All Customers. i.e. the parent is the filter, so when its set to a particular value, the child shows the Orders that belong to that Customer, but when its not selected, the child should show all Orders.

I have tried setting AutoBind to true, but that doesn't seem to help.

Is this possible?

Thanks,

Chris

@(Html.Kendo().DropDownList()
    .Name("Order")
    .DataTextField("Text")
    .DataValueField("Value")
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("OrderList", "List")
                .Data("filterOrders");
        })
        .ServerFiltering(true);
    })
    .OptionLabel("Please Select")
    .AutoBind(true)
    .CascadeFrom("Customer")
    .Enable(true)

Script
function filterOrders() {
    return {
        customerID: $("#Customer").val()
    };
}

Felix
Top achievements
Rank 1
commented on 12 Sep 2022, 11:35 AM

I also have the same scenario to provide to my product. Is it possible to bring a property to achieve this functionality.
Yanislav
Telerik team
commented on 14 Sep 2022, 07:54 AM

Hello Felix,

Currently, the API does not expose such functionality, but it is achievable with some custom implementation. However, if you have an idea of a specific functionality that the DropDownList could be improved with, we would suggest logging a feature request in our Feedback Portal. If you decide to log it, please elaborate more on how you envision this functionality to work.

The feature requests logged in the portal are reviewed and, based on the interest the community shows in them, they are planned accordingly for implementation in subsequent releases.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 01 Oct 2014, 07:47 AM
Hello Chris,

In general, the cascading functionality of the ComboBox, like the DropDownList, is designed to disable child widgets if parent hasn't any value. More information about the cascading feature can be found here. The described behavior cannot be changed and in order to accomplish your goal a custom implementation will be required. Here is a Dojo demo, that shows how to use change events of the widgets to perform data source filtration and disable/enable child widgets. You can use this approach as a starting point to implement your specific business logic.

Regards,
Georgi Krustev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or