gpt4 book ai didi

kendo-ui - 我没有在剑道下拉列表中找到占位符。任何人都可以建议我解决方案吗

转载 作者:行者123 更新时间:2023-12-02 22:15:35 25 4
gpt4 key购买 nike

我没有在剑道下拉列表中找到占位符。任何人都可以建议我解决方案

HTML

<input id="inp1" type="text"/>

JavaScript

var data1 = [ //this part is related to the above html tag
{text: "org1", value: "1", color: "#a8a9aa", selected:true },
{text: "org2", value: "2", color: "#000", selected: false },
{text: "org3", value: "3", color: "#000", selected: false },
{text: "org4", value: "4", color: "#000", selected: false },
{text: "org5", value: "5", color: "#000", selected: false }
];
$("#inp1").kendoDropDownList({
dataTextField : "text",
dataValueField: "value",
dataSource : data1,
placeholder:"select your option",
select : onSelect,
value :1
});

最佳答案

剑道下拉小部件没有“占位符”属性。相反,您可以通过放置一个“optionLabel”属性,即

 var data1 = [ //this part is related to the above html tag
{text: "org1", value: "1", color: "#a8a9aa", selected:true },
{text: "org2", value: "2", color: "#000", selected: false },
{text: "org3", value: "3", color: "#000", selected: false },
{text: "org4", value: "4", color: "#000", selected: false },
{text: "org5", value: "5", color: "#000", selected: false }
];

$("#inp1").kendoDropDownList({
dataTextField : "text",
dataValueField: "value",
dataSource : data1 ,
optionLabel : "select your option",
select : onSelect
});

确保“onSelect”函数是在 JavaScript 中定义的。供引用check here .

关于kendo-ui - 我没有在剑道下拉列表中找到占位符。任何人都可以建议我解决方案吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27099124/

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