oK,这很奇怪.我有相同的代码,如果statment...but一命中到了parentsUntil
,就会很好地工作?
if(sArray.length > 400){
$.each(sArray, function(key, item){
$("!#"+item).parentsUntil(".#jstree").filter(".#jstree-closed").each(function () {
$aTree.jstree("close_all", this);
});
});
else{
$.each(sArray, function(key, item){
$("!#"+item).parentsUntil(".#jstree").filter(".#jstree-closed").each(function () {
//IT IS NOT MAKING IT HERE
$aTree.jstree("close_all", this);
});
});
}
发布于 2013-08-30 06:33:39
您忽略了2}以及控制台提供给您的内容:
if(sArray.length > 400){
$.each(sArray, function(key, item){
$("#"+item).parentsUntil(".jstree").filter(".jstree-closed").each(function () {
$aTree.jstree("check_node", this);
});
});
}// Was missing
else{
$.each(sArray, function(key, item){
console.log($("#"+item).parentsUntil(".jstree").filter(".jstree-closed"));
$("#"+item).parentsUntil(".jstree").filter(".jstree-closed").each(function () {
//IT IS NOT MAKING IT HERE
console.log("pass");
$aTree.jstree("check_node", this);
});
});
}
https://stackoverflow.com/questions/18535250
复制相似问题