代码之家  ›  专栏  ›  技术社区  ›  Prisoner ZERO

DataSource.Read.BindTo for剑道组合框

  •  1
  • Prisoner ZERO  · 技术社区  · 7 年前

    出于某种原因,我的 MVC Kendo ComboBox READ ACTION DATA SOURCE

    我想做什么?

    问题
    显然,当您配置 BindTo DataSource.Read Action 绑定被忽略。

    我怎么知道的?

    • 当我在READ操作中设置断点时;看看客户端 dataSource._data 集合…它是空的

    此标记失败:
    因为。。。

    • 但是,读取会立即发生(这本身就有问题)


    @(Html.Kendo().ComboBoxFor(model => model.Entity.PrimaryCircuitConnectId)
          .Placeholder("Enter a Circuit Path...")
          .BindTo(new SelectList(Model.PrimaryCircuitConnectDetails, "CircuitConnectId", "CircuitConnectValue"))
          .MinLength(4)
          .Filter("startswith")
          .DataSource(source => source.Read(read => read.Action("find", "CircuitConnectDetail", new { area = "" })))
          .HtmlAttributes(new { style = "width:100%;" }))
    

    此标记失败:

    • 读取必须在客户端创建(手动)
    • 尽管如此,绑定是光荣的


    @(Html.Kendo().ComboBoxFor(model => model.Entity.PrimaryCircuitConnectId)
          .Placeholder("Enter a Circuit Path...")
          .BindTo(new SelectList(Model.PrimaryCircuitConnectDetails, "CircuitConnectId", "CircuitConnectValue"))
          .MinLength(4)
          .Filter("startswith")
          //.DataSource(source => source.Read(read => read.Action("find", "CircuitConnectDetail", new { area = "" })))
          .HtmlAttributes(new { style = "width:100%;" }))
    


    enter image description here

    1 回复  |  直到 7 年前
        1
  •  1
  •   Plamen Zdravkov    7 年前

    documentation article . 目前不建议在一个场景中同时使用它们。