本文介绍了在javascript数组中隐藏元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var question= dataQuestions;
我正在加载数组集合"dataQuestions".
下一个Iam在"0th"位置添加另一个项目,如下所示
I am loading "dataQuestions" which is an array collection.
next Iam adding another item at "0th" position as following
question.splice(0,0,{"Qid": 0,"Answer":null,"Text":""}
现在我
Now i am
function insertData(sQ, question) {
sQ.kendoDropDownList({
dataTextField : "Text",
dataValueField : "Qid",
dataSource : question
});
}
所以现在我的下拉列表中包含一些问题,例如"wht is ....?".但是在"0th"位置将有一个空行.
我希望该rowrow隐藏或不可点击.(基于我对下拉列表中任何问题的点击,某些功能会发生).
So now my dropdown contains few questions like "wht is....?".But at "0th" position there will be an empty row.
I want that emptyrow to hide or non clickable.(based on my click on any question in the dropdown some functionality happens).
Any help?
推荐答案
<select>
<option>Volvo</option>
<option>Saab</option>
<option disabled="disabled">Mercedes</option>
<option>Audi</option>
</select>
但我不知道您是否可以将此属性传递给kendoui下拉列表:(
But I don''t know if you can pass this property to the kendoui dropdown :(
这篇关于在javascript数组中隐藏元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!