PDA

View Full Version : Passing json collection to javascript function inside XTemplate.



xjpmauricio
16 Nov 2010, 3:07 AM
Hi, i have a function inside an XTemplate, i can pass data to this xtemplate by doing this:


myXTemplate.apply(record.data);


I have no problem passing single values but one of them is a json collection containing multiple values.
I cannot pass that collection it allways gives an error. This is the xtemplate:


var myXTemplate= new Ext.XTemplate(
'<a target="_self" href="javascript:ViewCrewMemberDetails({Id})">{Name}</a>' +
'<a class="resourceUnavailableIcon" target="_self" href="javascript:ViewAvailabilityDetails({Id});"></a>'
);


Tha javascript function ViewCrewMemberDetails({Id}) receives correctly the Id value because it's
a single value but if i pass a collection is gives an error.

Any ideias?