Apr 18, 2012, 9:21 PM
[CLOSED] Reference main store RecordField from a <for> structure in a template
Hi.
I have a GridPanel that has some complex Store structure.
I hope I was clear.
Thanks
Regadrs
Fernando
I have a GridPanel that has some complex Store structure.
<ext:Store ID="Store1" runat="server" OnRefreshData="ActualizarCoberturas" >
<Reader>
<ext:JsonReader IDProperty ="IndiceColeccion">
<Fields>
<ext:RecordField Name="Producto" IsComplex="true" />
<ext:RecordField Name="ProductoNombre" Mapping="Producto.Nombre" />
<ext:RecordField Name="ProveedorNombre" ServerMapping="Producto.EmpresaLocal.Proveedor.Denominacion" />
<ext:RecordField Name="FechaDesde" Type="Date" />
<ext:RecordField Name="FechaHasta" Type="Date" />
<ext:RecordField Name="PaisOrigen" IsComplex="true"/>
<ext:RecordField Name="PaisOrigenNombre" Mapping="PaisOrigen.Nombre"/>
<ext:RecordField Name="PaisDestino" IsComplex="true"/>
<ext:RecordField Name="PaisDestinoNombre" Mapping="PaisDestino.Nombre"/>
<ext:RecordField Name="Vouchers" IsComplex="true" />
<ext:RecordField Name="Contacto" IsComplex="true"/>
<ext:RecordField Name="ContactoNombre" ServerMapping="Contacto.Nombre"/>
<ext:RecordField Name="ContactoApellido" ServerMapping="Contacto.Apellido"/>
<ext:RecordField Name="ContactoTelefono" ServerMapping="Contacto.Telefono"/>
<ext:RecordField Name="ContactoEmail" ServerMapping="Contacto.Email"/>
<ext:RecordField Name="IndiceColeccion" />
</Fields>
</ext:JsonReader>
</Reader>
I show the "Vouchers" manually in a template with RowExpander plugin. Each voucher has a Name, Surname, and CollectionIndex to be referenced. (IndiceColeccion)
<ext:RowExpander ExpandOnDblClick="false" ExpandOnEnter="false">
<Template runat="server">
<Html>
<tpl for="Vouchers">
<tpl if="[xindex]==1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="EncabezadoGrillaGeneral">Viajeros</td>
</tr>
<tr >
<td class="EncabezadoGrillaParticular" style="width:40%;">Nombre</td>
<td class="EncabezadoGrillaParticular" style="width:40%;">Apellido</td>
<td class="EncabezadoGrillaParticular style="width:20%;""> </td>
</tr>
</tpl>
<tr>
<td class="CeldaViajeros">{AseguradoNombre}</td>
<td class="CeldaViajeros">{AseguradoApellido}</td>
<td class="CeldaViajeros"><a href="Javascript:EditarViajero({record.data.IndiceColeccion}, {IndiceColeccion});">Editar</a></td></tr>
<tpl if="[xcount-xindex]==0">
<tr><td colspan="3" style="height:8px;"> </td></tr>
</table>
</tpl>
</tpl>
</Html>
</Template>
</ext:RowExpander>
The function "EditarViajero" expects two references. IndiceColeccion (collection index) of the "Cobertura" (Coverage, or package) that contains the Voucher to be edited, and IndiceColeccion of the Voucher itself.<a href="Javascript:EditarViajero({record.data.IndiceColeccion}, {IndiceColeccion});">Editar</a>
The IndiceColeccion of the voucher is rendered well {IndiceColeccion}, but I don't know how to refer back data from the main Store (IndiceColeccion of the main items iterated by the grid). I tryed that {record.data.IndiceColeccion} without success. 'record' is not recognized.I hope I was clear.
Thanks
Regadrs
Fernando
Last edited by Daniil; Apr 20, 2012 at 12:40 PM.
Reason: [CLOSED]