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

Cascading ComboBox Datasource empty when browser back button is used

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Sep 2015, 12:49 PM

I am storing the values selected with my Cascading ComboBoxes in the local storage so it will remember what they have chosen.  The problem is when the browser back button in clicked, the Cascaded combobox's Datasource is empty so when I set the value it just puts the # in the drop down instead of showing the selected item.  

 From what I can tell it is not calling the read method when the back button is pressed and is not cacheing the list since I am using ServerFiltering.  I have even tried manually calling the read method of the datasource in JavaScript but to no avail.

 How can I get this list to re-populate when the back button is used?

<div class="col-md-6">
    @(Html.Kendo().ComboBox()
        .Name("Clients")
        .DataValueField("ClientId")
        .DataTextField("ClientName")
        .Placeholder("Select Client...")
        .Filter(FilterType.Contains)
        .Events(events => events.Cascade("Clients_cascade").Change("Clients_change"))
        .DataSource(ds => ds
            .Read(read => read.Action("GetClients", "Home")))
    )
</div>
<div class="col-md-6">
    @(Html.Kendo().ComboBox()
        .Name("Projects")
        .DataValueField("ProjectId")
        .DataTextField("ProjectName")
        .Placeholder("Select Project...")
        .Filter(FilterType.Contains)
        .AutoBind(false)
        .CascadeFrom("Clients")
        .Events(events => events.Change("Projects_change"))
        .DataSource(ds => ds
            .Read(read => read.Action("GetProjectsForClient", "Home").Data("FilterProjects"))
            .ServerFiltering(true)
            .Events(events => events.Error("Projects_error")))
    )
</div>

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 11 Sep 2015, 10:50 AM
Hello Robert,

In general, the widget will request the data from the server if serverFiltering is enabled. Here is a Dojo demo that shows this in action: and the related screencast:
Could you let me know if I am missing something? Note that the given demo is applicable to ASP.NET MVC too, as the widget's behavior does not differ between Kendo UI and UI for ASP.NET MVC.

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or