Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help constructing object with array
Message
 
À
28/03/2012 07:22:56
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01539532
Message ID:
01539545
Vues:
29
Hey Tore
Great to see you as well! I am still in Israel, moved to a different city :-)
...and if by country you meant VFP, i still have plenty of ongoing projects in VFP, but doing new stuff with other tools at the same time...

>Hi Jaime,
>
>long time, no see! And I notice that you have moved to another country?
>
>>Hi
>>I think this is a basic javascript question, but in online tutorials i didn't find how to build something similar.
>>I currently have a curObj object, in which one of the properties is a subObj array. Here is some code:
>>curObj.subObj = {};
>>//tempData is an array holding data, and dateStr holds my current date
>>var menuItems = [];
>>
>>for(var i = 0; i < tempData.length; i++) {
>>	menuItems.push({
>>		html: '<span title="'+tempData[i].detail+'">' + tempData[i].name + '</span>',
>>		onClick: Function('editEvent(\'' + tempData[i].id + '\')')});
>>	}	
>>
>>	curObj.subObj[dateStr] = menuItems;
>>}
>>As you can see i load the menuItems array into the subObj property, but what i would like subObj is to hold a customerName property as well, so it should be something like:
>>
>>curObj.subObj[dateStr] = {customerName, menuItems Array}
>>
>>How can i do that?
>>
>>Thanks
>>Jaime
Why do programs stop working correctly as soon as you leave the Fox?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform