Hi,
wouldn't it be better to use just one bind function in the delegate to both:
folders and leaves? and have a way to test if a node is leaf or not?
i.e as it is currently:
// delegate implementation bindNode : function(controller, item, id) {
controller.bindDefaultProperties(item, id); controller.bindProperty("size",
"size", null, item, id); controller.bindProperty("checked", "checked", null,
item, id); controller.bindPropertyReverse("checked", "checked", null, item,
id); controller.bindProperty("date", "date", null, item, id); controller.
bindProperty("mode", "mode", null, item, id); controller.bindProperty(
"light", "leadIcon", { converter : function(data) { return data ?
"icon/16/status/dialog-information.png" : ""; } }, item, id); }, // delegate
implementation bindLeaf : function(controller, item, id) { controller.
bindDefaultProperties(item, id); controller.bindProperty("size", "size",
null, item, id); controller.bindProperty("checked", "checked", null, item,
id); controller.bindPropertyReverse("checked", "checked", null, item, id);
controller.bindProperty("date", "date", null, item, id); controller.
bindProperty("mode", "mode", null, item, id); controller.bindProperty(
"light", "leadIcon", { converter : function(data) { return data ?
"icon/16/status/dialog-information.png" : ""; } }, item, id); },
suggested:
// delegate implementation bindNode : function(controller, item, id) {
if (item.isLeaf())
{
//do something
} else
{
// do something else
} }
I know it's not finished or anything. But those changes are better done
early than latter.
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel