Hi,
I have this class who contains a « childrens » property of type «
qx.data.Array »
I declared an event on my « childrens » property : _eventChildrens
My event _eventChildrens is never call when my list is changed
I dont understand what is my error
My class :
qx.Class.define("com.lanauco.mobile.core.MenuManager",
{
extend : com.lanauco.mobile.core.MenuItem,
construct : function(id, title, parent, image, action, subtitle,
order) {
this.base(arguments, id, title, parent, image, action,
subtitle, order);
this.childrens = new qx.data.Array();
},
members : {
addChildren: function(newChildren){
newChildren.setParent(this);
this.childrens.push(newChildren);
},
dropChildren: function(childrenId){
var childrenIndex = this.findChildrenIndex(childrenId);
if(childrenIndex >= 0){
this.childrens.splice(childrenIndex,1);
}else{
throw new Error("Children to drop '" + childrenId + "'
was not found in menu " + this.id);
}
},
haveChildrens: function(){
if(this.childrens.length > 0){
return true;
}
return false;
},
getChildrens: function(){
return this.childrens;
},
printMenu: function(level){
if(!level){
console.log(this.title);
}
level = (level ? level : ">");
var items = this.childrens.toArray();
for(var iCtr = 0; iCtr < items.length; iCtr++){
var item = items[iCtr];
console.log(level + item.title);
if(item instanceof
com.lanauco.mobile.core.MenuManager){
item.printMenu(level+level);
}
}
},
findMenu: function(id, searchInSubMenu){
var items = this.childrens.toArray();
searchInSubMenu = (searchInSubMenu ? searchInSubMenu :
true);
for(var iCtr = 0; iCtr < items.length; iCtr++){
var item = items[iCtr];
if(item.id == id){
return item
}else if(item instanceof
com.lanauco.mobile.core.MenuManager && searchInSubMenu){
var result = item.findMenu(id);
if(result != null){
console.log("Menu '" + id + "' was found in '"
+ item.id + "' : " + result);
return result;
}
}
}
return null;
},
findChildrenIndex: function(id){
var items = this.childrens.toArray();
for(var iCtr = 0; iCtr < items.length; iCtr++){
var item = items[iCtr];
if(item.id == id){
return iCtr;
}
}
return -1;
},
sort: function(){
var myList = this.childrens;
myList.sort(function(var1, var2){
var result = null;
if(var1.order > var2.order){
result = 1;
}else if(var1.order == var2.order){
result = 0;
}else{
result = -1
}
return result
});
this.childrens = myList;
},
_eventChildrens: function(value, old, name) {
console.log("_eventChildrens");
}
},
events: {
"_eventChildrens" : "qx.event.type.Data"
},
properties :
{
childrens:{
check: "qx.data.Array",
init: new qx.data.Array(),
event: "_eventChildrens"
}
}
});
Thank you
Marc-André Dubois
[email protected]
Programmeur-Analyste
Description : Lanauco_logo_couleur_long Signature
1.877.881.5151 p.261 (sans frais).
450.831.5151 p.261
450.839.1103 (Fax)
Web : <http://www.lanauco.com/> http://www.lanauco.com
<<image001.png>>
------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
