Possible Duplicate:
How to break or continue Ext.each
exactly what i want to achieve is to check a string in an array,..
if the privilege is true, then returntrue
...
var Data = {
appPrivilege : [{
module : "info",
priv : true
},{
module : "about",
priv : false
}]
}
App = {
AP : function(a){
Ext.each(Data.appPrivilege, function(c){
if (c.module == a && c.priv==true){
console.info("here");
//return true;
return "a";
}
});
return "b";
}
}
console.info(App.AP("info"));
but in firebug it show here
and b
. how to terminate Ext.each
??
Ext and jQuery just wants the callback to return false
if (c.module == a && c.priv==true){
console.info("here");
return false;
}
精彩评论