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

Problem deselecting 4 or more cascading dropDownList

9 Answers 84 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Amos
Top achievements
Rank 1
Amos asked on 26 Sep 2012, 02:09 PM
Hi,
I have a problem with 4 or more cascading dropDownList.
When I deselect the first dropDownList, last is not correctly refreshed (initialized)
Could you help me?
Thank you,
Amos

<p>
    <label for="categories">Catergories:</label>
    @(Html.Kendo().ComboBox()
          .Name("categories")
          .Placeholder("Select categoryasdasda...")
          .DataTextField("Cod")
          .DataValueField("Des")
          .DataSource(source => {
               source.Read(read => {
                   read.Action("GetCascadeCategories", "ComboBox");
               });
          })
    )
</p>
<p>
    <label for="products">Products:</label>
    @(Html.Kendo().ComboBox()
          .Name("products")
          .Placeholder("Select product...")
                     .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeProducts", "ComboBox")
                      .Data("filterProducts");
              })
              .ServerFiltering(true);
          })
          .Enable(false)
          .AutoBind(false)
          .CascadeFrom("categories")
    )
    <script>
        function filterProducts() {
            return {
                categories: $("#categories").val()
            };
        }
    </script>
</p>
<p>
    <label for="orders">Orders:</label>
    @(Html.Kendo().ComboBox()
           .Name("orders")
           .Placeholder("Select order...")
                      .DataTextField("Cod")
                  .DataValueField("Des")
           .DataSource(source => {
                                     source.Read(read =>
                                                     {
                                                         read.Action("GetCascadeOrders", "ComboBox")
                                                             .Data("filterOrders");
                                                     })
                                         .ServerFiltering(true);
           })
           .Enable(false)
           .AutoBind(false)
           .CascadeFrom("products")
          )
    <script>
        function filterOrders() {
            return {
                products: $("#filterOrders").val()
            };
        }
    </script>
</p>
<p>
    <label for="ciccio">Ciccio:</label>
    @(Html.Kendo().ComboBox()
          .Name("ciccio")
          .Placeholder("Select order...")
                    .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeciccio", "ComboBox");
              })
              .ServerFiltering(true);
          })
      
          .AutoBind(false)
                          .CascadeFrom("orders")
    )
    <script>
        function filterOrders() {
            return {
                ciccio: $("#filterCiccio").val()
            };
        }
    </script>
</p>

9 Answers, 1 is accepted

Sort by
0
serdar
Top achievements
Rank 1
answered on 30 Sep 2012, 12:24 PM
I'm having the same problem
0
Petur Subev
Telerik team
answered on 01 Oct 2012, 08:24 AM
Hi guys,

Basically there should not be any issues no matter how many cascading comboboxes you use.

@Amos
In the last of your ComboBoxes I do not see any Data method of your Read action specified. Also the filterOrders function seems to be defined twice.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Amos
Top achievements
Rank 1
answered on 02 Oct 2012, 08:01 AM
Hi,
it was my error. Anyway I tried this code but doesn't work.
<p>
    <label for="categories">Catergories:</label>
    @(Html.Kendo().ComboBox()
          .Name("categories")
          .Placeholder("Select categoryasdasda...")
          .DataTextField("Cod")
          .DataValueField("Des")
          .DataSource(source => {
               source.Read(read => {
                   read.Action("GetCascadeCategories", "ComboBox");
               });
          })
    )
</p>
<p>
    <label for="products">Products:</label>
    @(Html.Kendo().ComboBox()
          .Name("products")
          .Placeholder("Select product...")
                     .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeProducts", "ComboBox")
                      .Data("filterProducts");
              })
              .ServerFiltering(true);
          })
          .Enable(false)
          .AutoBind(false)
          .CascadeFrom("categories")
    )
    <script>
        function filterProducts() {
            return {
                categories: $("#categories").val()
            };
        }
    </script>
</p>
<p>
    <label for="orders">Orders:</label>
    @(Html.Kendo().ComboBox()
           .Name("orders")
           .Placeholder("Select order...")
                      .DataTextField("Cod")
                  .DataValueField("Des")
           .DataSource(source => {
                                     source.Read(read =>
                                                     {
                                                         read.Action("GetCascadeOrders", "ComboBox")
                                                             .Data("filterOrders");
                                                     })
                                         .ServerFiltering(true);
           })
           .Enable(false)
           .AutoBind(false)
           .CascadeFrom("products")
          )
    <script>
        function filterOrders() {
            return {
                products: $("#filterOrders").val()
            };
        }
    </script>
</p>
<p>
    <label for="ciccio">Ciccio:</label>
    @(Html.Kendo().ComboBox()
          .Name("ciccio")
          .Placeholder("Select order...")
                    .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeciccio", "ComboBox").Data("filterCiccio");
              })
              .ServerFiltering(true);
          })
      
          .AutoBind(false)
                          .CascadeFrom("orders")
    )
    <script>
        function filterCiccio() {
            return {
                ciccio: $("#filterCiccio").val()
            };
        }
    </script>
</p>
0
Petur Subev
Telerik team
answered on 05 Oct 2012, 09:09 AM
Hello Amos,

Could you please share a sample project which reproduces that problem and so we can search the reason for that behavior?

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Amos
Top achievements
Rank 1
answered on 05 Oct 2012, 12:09 PM
Hello Petur,
I attached your asp net mvc MVC example with my changes.
If you build you can see the problem in this route

http://localhost:53702/razor/web/combobox/cascadingcombobox

Thank you.
Amos
0
Petur Subev
Telerik team
answered on 10 Oct 2012, 11:19 AM
Hello Amos,

Please find the correct code below and check the highlights for the differences applied:

<p>
    <label for="categories">Catergories:</label>
    @(Html.Kendo().ComboBox()
          .Name("categories")
          .Placeholder("Select categoryasdasda...")
          .DataTextField("Cod")
          .DataValueField("Des")
          .DataSource(source => {
               source.Read(read => {
                   read.Action("GetCascadeCategories", "ComboBox");
               });
          })
    )
</p>
<p>
    <label for="products">Products:</label>
    @(Html.Kendo().ComboBox()
          .Name("products")
          .Placeholder("Select product...")
                     .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeProducts", "ComboBox")
                      .Data("filterProducts");
              })
              .ServerFiltering(true);
          })
          .Enable(false)
          .AutoBind(false)
          .CascadeFrom("categories")
    )
    <script>
        function filterProducts() {
            return {
                categories: $("#categories").val()
            };
        }
    </script>
</p>
<p>
    <label for="orders">Orders:</label>
    @(Html.Kendo().ComboBox()
           .Name("orders")
           .Placeholder("Select order...")
                      .DataTextField("Cod")
                  .DataValueField("Des")
           .DataSource(source => {
                                     source.Read(read =>
                                                     {
                                                         read.Action("GetCascadeOrders", "ComboBox")
                                                             .Data("filterOrders");
                                                     })
                                         .ServerFiltering(true);
           })
           .Enable(false)
           .AutoBind(false)
           .CascadeFrom("products")
          )
    <script>
        function filterOrders() {
            return {
                products: $("#products").val()
            };
        }
    </script>
</p>
<p>
    <label for="ciccio">Ciccio:</label>
    @(Html.Kendo().ComboBox()
          .Name("ciccio")
          .Placeholder("Select order...")
                    .DataTextField("Cod")
                  .DataValueField("Des")
          .DataSource(source => {
              source.Read(read =>
              {
                  read.Action("GetCascadeciccio", "ComboBox").Data("filterCiccio");
              })
              .ServerFiltering(true);
          })
      
          .AutoBind(false)
                          .CascadeFrom("orders")
    )
    <script>
        function filterCiccio() {
            return {
                orders: $("#orders").val()
            };
        }
    </script>
</p>

You should follow the logic to send the value of the previous selected ComboBox to the Select method of the next ComboBox.
Also do not forget to name the arguments in the Action methods the same way.

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Amos
Top achievements
Rank 1
answered on 10 Oct 2012, 04:30 PM
Hello,
I used your code but when I deselect the first element, last is not correctly disabled.
You can see this in the screenshot that I attached.
So the problem persist.
Could you help me?
Thank you.
Amos
0
Amos
Top achievements
Rank 1
answered on 22 Oct 2012, 08:30 AM
No one knows how to help me?
My company would be interested in buying this product but if I don't know how to make it work I cannot propose it to my managers.
Thank you.
Amos
0
Danny
Top achievements
Rank 1
answered on 25 Oct 2012, 02:39 PM
Hello,

I am also seeing exactly the same issue.  Has anyone determined a fix for it yet?
Tags
DropDownList
Asked by
Amos
Top achievements
Rank 1
Answers by
serdar
Top achievements
Rank 1
Petur Subev
Telerik team
Amos
Top achievements
Rank 1
Danny
Top achievements
Rank 1
Share this question
or