【发布时间】:2020-06-14 13:31:48
【问题描述】:
我必须在局部视图中添加一个 Kendo jQuery 组合框,我已经跟进了这个示例:https://demos.telerik.com/kendo-ui/combobox/index 并从输入元素和选择元素添加了一个组合框。
但是输入和选择元素没有显示为组合框,而是显示了它们的默认性质(在此处添加图像以供参考,例如选择文本/占位符不可编辑)
example.cshtml 文件:
@model ExampleModel
<div class="demo">
<h4><label for="fabric">T-shirt Fabric</label></h4>
<input id="fabric" placeholder="Select fabric..." style="width: 100%;" />
<h4 style= "margin-top: 2em;" ><label for="size">T-shirt Size</label></h4>
<select id="size" placeholder="Select size..." style="width: 100%;">
<option> X - Small </option>
<option> Small </option>
<option> Medium </option>
<option> Large </option>
<option> X - Large </option>
<option> 2X-Large</option>
</select>
</div>
<script>
$(document).ready(function () {
console.log("inside doc ready");
$("#fabric").kendoComboBox({
dataTextField: "text",
dataValueField: "value",
dataSource: [
{ text: "Cotton", value: "1" },
{ text: "Polyester", value: "2" },
{ text: "Cotton/Polyester", value: "3" },
{ text: "Rib Knit", value: "4" }
],
filter: "contains",
suggest: true,
index: 3
});
// create ComboBox from select HTML element
$("#size").kendoComboBox();
});
</script>
我还跟进了 StackOverflow 上的其他答案,但我没有清楚地了解需要添加哪些引用(脚本和链接标签)以及在哪里添加?
需要添加以下脚本和链接标签,我认为是这样:
<link rel="stylesheet" href="styles/kendo.common.min.css" />
<link rel="stylesheet" href="styles/kendo.default.min.css" />
<link rel="stylesheet" href="styles/kendo.default.mobile.min.css" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script
【问题讨论】:
标签: asp.net-mvc asp.net-core razor kendo-ui kendo-combobox