samedi 16 juillet 2016

Kendo UI Combobox is not refreshing after submit clicked

I am trying to refresh kendo combobox fields after post method triggered.

But always combobox gets selected items after post.

Code is here:

@(Html.Kendo().ComboBoxFor(p => p.KurumKodu)
    .ValuePrimitive(true)
    .Name("KurumKodu")
    .DataTextField("HospitalName")
    .DataValueField("HospitalId")
    .HtmlAttributes(new { style = "width: 300px;margin-right:5px;", @class = "form-control" })
    .Filter(FilterType.Contains)
    .Placeholder("Kurum Seçiniz...")
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("GetCascadeHospitals", "SptsCustom")
                .Data("filterHospitals");
        })
        .ServerFiltering(true);
    })
    .Enable(false)
    .AutoBind(false)
) 

I tried this codes for refreshing

 $("#KurumKodu").data("kendoComboBox").input.val("");

 $("#KurumKodu").data("kendoComboBox").dataSource.read();

But they don't help.

How can we solve this?

Thanks

Aucun commentaire:

Enregistrer un commentaire