Ext.each Ext.query , foreach

  var people = ['Bill', 'Saul', 'Gaius'];

 

//using each to detect Cylons:

 var f=function (person, index)

{

    var cylon = (index + 1) % 2 == 0; //every second man is a toaster

    alert(person + (cylon ? ' is ' : ' is not ') + 'a fraking cylon');

}

Ext.each(people,f);


Ext.query
//清空form checkbox输入框值
	Ext.each(Ext.query("form input[type='checkbox'][name^=mailTargetConfig]"),function(ckd, index){ckd.checked=false});
---------------------------------------------------------------------
Ext.query("form input[type='checkbox'][name^=mailTargetConfig]").forEach(function(item,index,items){item.checked=false});


Extjs学习笔记--(四,基本函数介绍)
http://www.cnblogs.com/anbylau2130/p/3581755.html

猜你喜欢

转载自snowelf.iteye.com/blog/2121457
ext
今日推荐