Hey,
you can either use closures [1] or function bind [2] to bring variables to
listeners. Other than that, you can also use the parent chain [3] of the
widgets to walk through the data. As I don't know the exact scope of your
request, I can't give you a better suggestion than these three.
Regards,
Martin
[1] https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Closures
[2]
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
[3]
http://demo.qooxdoo.org/current/apiviewer/#qx.ui.tree.core.AbstractTreeItem~parent
Am 28.09.2012 um 11:57 schrieb Ravi Lal
<[email protected]<mailto:[email protected]>>:
Hi,
I am using a tree widget and have multiple nested listeners so when a user
clicks on a folder it gets dynamically populated.
The problem I am having is a way of accessing variables outside of the
listeners scope. For example:
leaf.addListener("click",
function(e) {
alert(arguments[2]);
var label = new qx.ui.basic.Label(
WANT TO ACCESS VALUES OF ARTICLES[j]);
label.setRich(true);
container2.add(label);
WANT ACCESS TO THE CONTAINER HERE TOO
}, this, articles[j]);
I don't want to add everything to this.__ and make them global as I have a
lot of data and I have multiple variables so can't push them through
'this'.
Is there a cleaner way to do what I want ?
Thanks.
_______________________________________________________________________
The BMJ Group is one of the world's most trusted providers of medical
information for doctors, researchers, health care workers and patients
group.bmj.com<http://group.bmj.com>. This email and any attachments are
confidential. If you have received this email in error, please delete it and
kindly notify us. If the email contains personal views then the BMJ Group
accepts no responsibility for these statements. The recipient should check
this email and attachments for viruses because the BMJ Group accepts no
liability for any damage caused by viruses. Emails sent or received by the BMJ
Group may be monitored for size, traffic, distribution and content. BMJ
Publishing Group Limited trading as BMJ Group. A private limited company,
registered in England and Wales under registration number 03102371. Registered
office: BMA House, Tavistock Square, London WC1H 9JR, UK.
_______________________________________________________________________
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel