【问题标题】:How to set the initial text of a kendo combo box inside a kendo grid edit row如何在剑道网格编辑行中设置剑道组合框的初始文本
【发布时间】:2014-01-22 08:58:07
【问题描述】:

我正在使用编辑器模板为我的网格中的一列显示一个组合框。我想从 value 属性以外的模型属性设置组合框的初始文本。我通常可以使用 Text 运算符来执行此操作,但因为这是在网格内,所以我需要从该特定行的数据中加载。这是我的编辑器模板代码:

@(Html.Kendo().ComboBoxFor(Function(x) x) _
.DataTextField("PartNumber") _
.DataValueField("PartID") _
.MinLength(2) _
.AutoBind(False) _
.Text(  "what do I put here"  ) _
.Filter(FilterType.StartsWith) _
.DataSource(Sub(dataSource)
                    dataSource _
                    .Read(Sub(reader)
                                  reader.Action("StartsWith", "Part")
                                  reader.Type(HttpVerbs.Post)
                          End Sub) _
                    .ServerFiltering(True)
            End Sub)
)

【问题讨论】:

    标签: kendo-ui kendo-grid kendo-combobox


    【解决方案1】:

    你可以调用一个可以满足你目的的javascript函数

    function categoryDropDownEditor(container, options) {
            $('<input data-text-field="PartNumber" data-value-field="PartID" data-bind="value:' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                autoBind: false,
                dataSource: data //Your Data
                }
            });
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-07
      • 2014-04-29
      • 2012-02-14
      相关资源
      最近更新 更多