0
我正在计算Kendo UI DropDownList的计数,但我没有得到正确的价值。通过计算Kendo UI的数量,我想从Kendo DropDownList中删除最后一项。 我试着以下但不工作:获取Kendo UI的计数/长度/大小DropDownList
1.
var dropDown = $("#RoleDrp").data("kendoDropDownList");
var len = dropDown.value().length+1;
var itemToRemove = dropDown.dataSource.at(len);
dropDown.dataSource.remove(itemToRemove);
dropDown.select(0);
我越来越长为6,但我在DropDownList中共有13项。
2.
var len = dropDown.length;
我越来越不确定。
试试这个:-var下拉= $( “#RoleDrp”)的数据( “kendoDropDownList”)。 var lengthOfDropDown = dropDown.dataSource._data.length; –