qx.class.define returns the newly defined class.

you can just do this:

var class_name = "some.class.Name"
var class_map = { /* regular qooxdoo class definition go here */ }
SomeClass = qx.Class.define(cn, class_map);
some_instance = new SomeClass();

no need to use eval or similar monstrosity.

hth,
burak

On 12/23/11 20:58, Simon White wrote:
> Hi
>
> I would like to be able to create a new class by building the class name
> at runtime as opposed to hard coding the class in code.  Can this be done?
>
> For example instead of
>
> var lo = new dcbase.myCustomerButton();
>
> I would like to do the following:
>
> var lcClass = myWindow.Classname.substr(1,8)+"_con"+myButton.getLabel()
>
> var = new lcClass;
>
> Thanks,
> Simon
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to