gpt4 book ai didi

javascript - Kendo 多选下拉列表不显示值

转载 作者:行者123 更新时间:2023-12-03 06:46:32 28 4
gpt4 key购买 nike

我尝试使用示例将值绑定(bind)到 Kendo 多选下拉列表,但无法在下拉列表中显示数据。

Tried to use this example in Kendo

My trails are here

<div id="example" ng-app="KendoDemos">
<div class="demo-section k-content" ng-controller="MyCtrl">
{{selectOptions}}
<h4>Select product</h4>
<select kendo-multi-select k-options="selectOptions" k-ng-model="selectedIds"></select>
<p ng-show="selectedIds.length" style="padding-top: 1em;">Selected: {{ selectedIds }}</p>

</div>
</div>

<script>
angular.module("KendoDemos", [ "kendo.directives" ])
.controller("MyCtrl", function($scope){
$scope.selectOptions = ['abc','def'];
$scope.selectedIds = [ 4, 7 ];
})
</script>

最佳答案

这就是我使用 kendoUI 多重选择的方式

<select kendo-multi-select k-options="selectOptions" k-ng-model="selectedIds" required></select>


$scope.selectOptions = {
placeholder: "Select DimLinks...",
dataTextField: "LINK_NAME",
dataValueField: "PK_DIM_LINK",
valuePrimitive: true,
autoBind: false,
dataSource: {
serverFiltering: true,
transport: {
read: {
url: "api/DimLinks",
}
}
}
};
$scope.selectedIds = [4, 7];

看看这是否有帮助。

关于javascript - Kendo 多选下拉列表不显示值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37714895/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com