I'm trying to use Ext.each.
It throughs an error: this.el.dom has no properties
Here's how I call it:
attachDate looks like this:
I tried casting 'item' in the function to an element, but that didn't change it.
Any idea what I'm doing wrong?
Thanks...martin
It throughs an error: this.el.dom has no properties
Here's how I call it:
var ds = ctxtObj.select("input.date", true);//.on("click", this.showDate);
Ext.each(ds, this.attachDate, this);
attachDate : function(item, index, allItems){
var d = new Ext.form.DateField({
target: item,
value: '02/28/2007',
format: 'm/d/Y'});
},
Any idea what I'm doing wrong?
Thanks...martin

|
#2
|
|
Each operates on an array. A composite element is not an array. However, the CompositeElement class has it's own each method to make this easy.
var ds = ctxtObj.select("input.date", true);//.on("click", this.showDate); //Ext.each(ds, this.attachDate, this); ds.each(this.attachDate, this); However, you can use it's "elements" property (array) with each. ![]() |
本文讨论了在Ext.js中使用Ext.each方法时遇到的问题,特别是当尝试遍历通过CompositeElement类获得的对象时出现的错误。文章提供了正确的使用方法,并解释了如何使用CompositeElement的each方法来替代。

被折叠的 条评论
为什么被折叠?



