【问题标题】:Kendo dropdownlist set selected item with angularjsKendo 下拉列表使用 angularjs 设置所选项目
【发布时间】:2015-03-29 16:29:40
【问题描述】:

在带有 kendo ui 下拉列表的 angularjs 中,如何设置所选项目?

如果我有这个控制:

<select name="product" kendo-drop-down-list style="width: 200px" k-options="customOptions" ng-model="newProduct.name"></select>

在 angularjs 控制器中:

$scope.newProduct.icon

已选择项目的索引(没关系)。但是如何设置项目呢?

【问题讨论】:

  • 你能创建一个 plunkr/fiddle

标签: angularjs kendo-ui kendo-dropdown


【解决方案1】:

尝试在 k-data-text-field 和 ng-model 中设置您想要的属性以保存整个对象,这样只需更改该对象即可。

<select name="product" kendo-drop-down-list style="width: 200px" k-options="customOptions" ng-model="newProduct" k-data-text-field="'name'"></select>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-28
    • 1970-01-01
    相关资源
    最近更新 更多