var obj = {}; if(dojo.isString(item)){ dojo.forEach(this.attrs, function(attr){ obj[attr] = (attr == "value") ? item : this.defaultValue; }, this); }else{ dojo.forEach(this.attrs, function(attr){ if(this.store){ obj[attr] = this.store.getValue(item, attr)||this.defaultValue; }else{ obj[attr] = item[attr]||this.defaultValue; } }, this); } return obj;