Page 1 of 1

out of anonymous function code assist in Extjs

Posted: Sat Mar 13, 2010 5:11 pm
by beyaz
Hi. My profile is Extjs in spket. Problem is here

Code: Select all


Byz = {    /**
		 * @returns {Function}
		 */
		get:function(/*String*/key)
		{   
		   return function(){ return this[key]; };
		},
		set:function( /*String*/ key)
		{
		    return function(value){ this[key] = value; };
		}};


(function(){
Byz.UserInfo = Ext.extend(Object,{
	 	/**
	 	 * @return {String}
	 	 */
	 	getUserName:Byz.get("userName") 	
 	});
   

    var o = new Byz.UserInfo();
   o.getUserName();  // working as function good ! 
 	
 })();

  var o2 = new Byz.UserInfo();
   o2.getUserName();  // not working as function but working like a field 

Any solution ?

Posted: Sun Mar 14, 2010 2:30 am
by eric_suen
Thanks for report this bug