kendo ComboBox(Web UI)中“清除”按钮的问题

时间:2019-06-03 09:12:14

标签: javascript c# asp.net-mvc combobox kendo-ui

我的cshtml页面中有一个ComboBox。

@(Html.Kendo().ComboBoxFor(x => x.VehicleId)
  .Name("VehicleId")
  .Text(Model.VehicleNumber)
  .DataTextField("Number")
  .DataValueField("Id")
  .HighlightFirst(false)
  .DataSource(source =>
  {
    source.Custom().ServerFiltering(true).ServerPaging(true).PageSize(20).Type("aspnetmvc-ajax")
      .Transport(transport =>
      {
        transport.Read(read => read.Action("GetVehicles", "InspectionTasks",new {itid=Model.Id }));
      })
      .Schema(schema =>
      {
        schema.Data("Data").Total("Total");
      });
  })
  .Filter(FilterType.Contains)
  .AutoBind(false)
  .Virtual(x => x.ItemHeight(30).ValueMapper("VehiclesValueMapper")))

这是页面上的comboBox。

comboBox

当我单击“清除”按钮时,方法GetVehicles(comboBox中的DataSource方法)由于某种原因而调用,并且该字段未清除。只有再次单击“清除”后,该字段才会清除。

是否可以在不调用方法GetVehicles的情况下清除组合框?任何帮助表示赞赏。

0 个答案:

没有答案