On Thu, May 16, 2013 at 10:17 AM, Benjamin Dreux <dreux.benja...@uqam.ca>wrote:
> Hi
>
> I'm looking at qx.ui.table.Table source code.
> And i've noticed this
> this.__selectionManager = this.getNewSelectionManager()(this);
> I don't point this as beeing an error.
> I'm sure there is a really good reason for this.
> Could someone explain what this line do. why this "(this)" is used??
>
That's really old code. I wrote it, and I'll take the blame. :-)
Notice that getNewSelectionManager is a function that's being called. That
function returns another function, which is the one that instantiates the
selection manager. At the time I wrote it, I think I probably didn't know
how to bind that inner function to a particular context, so I had the
context be passed to the inner function so it could reference Table
instance members. Were I to do it today, I would likely have bound the
inner function to that context, so that when called, it already had the
proper context as 'this'. Changing it at this point, though, would not be
backward compatible.
Derrell
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel