Nov 23, 2012, 3:13 PM
[CLOSED] Mapping gridpanel to complex store
Hi guys, i have the following JSON: http://paste2.org/p/2511356 (It's long so i posted there...)
I'm mapping it to a Store like this:
I want to be able to show the grid anyways.
Also, i have a grid and i want to map it to the store.
If i set recordfield as complex (leaving only "Producto" as the name with no mapping), the DataIndex of the column should be "Producto.Nombre" ?
How can i map a gridpanel to a complex mapped stored?
I'm mapping it to a Store like this:
<tlf:Storage AutoLoad="false" ID="storeTelecontrolEventos" runat="server">
<Proxy>
<ext:HttpProxy Method="GET" Json="true" Url="TelecontrolHandler.ashx" />
</Proxy>
<BaseParams>
<ext:Parameter Name="Operation" Value="GetEventos" Mode="Value" />
</BaseParams>
<Reader>
<ext:JsonReader Root="telecontrol.Eventos">
<Fields>
<ext:RecordField Name="IdTelecontrolEvento" Type="Int" />
<ext:RecordField Name="IdTelecontrolCabecera" Type="Int" />
<ext:RecordField Name="Senal" Mapping="Senal.Nombre" />
<ext:RecordField Name="Fecha" Type="Date" />
<ext:RecordField Name="HoraEmision" />
<ext:RecordField Name="FechaEmision" Type="Date" />
<ext:RecordField Name="TipoEventoTelecontrol" Mapping="TipoEventoTelecontrol.Nombre" />
<ext:RecordField Name="Programa" Mapping="Programa.Nombre" />
<ext:RecordField Name="Variante" Mapping="Variante.Nombre" />
<ext:RecordField Name="NroBloque" Type="Int" />
<ext:RecordField Name="OrdenEnBloque" Type="Int"/>
<ext:RecordField Name="Material" Mapping="Material.NumeroYNombre" />
<ext:RecordField Name="Duracion" Type="Int" />
<ext:RecordField Name="Producto" Mapping="Producto.Nombre" />
<ext:RecordField Name="Anunciante" Mapping="Anunciante.RazonSocial" />
<ext:RecordField Name="Orden" Mapping="IdOrden" />
<ext:RecordField Name="Observaciones" />
<ext:RecordField Name="Telecontrolado" />
<ext:RecordField Name="IdSchedulerEvento" Type="Int" />
<ext:RecordField Name="IdNovedadAsRun" Type="Int" />
<ext:RecordField Name="IdNovedadMonitor" Type="Int" />
<ext:RecordField Name="IdResultadoTelecontrol" Type="Int" />
<ext:RecordField Name="FechaAlta" Type="Date" />
<ext:RecordField Name="FechaModif" Type="Date" />
<ext:RecordField Name="UsuarioAlta" />
<ext:RecordField Name="UsuarioModif" />
</Fields>
</ext:JsonReader>
</Reader>
<BaseParams>
<ext:Parameter Name="Operation" Value="GetEventos" Mode="Value" />
<ext:Parameter Name="IdTelecontrol" Value="0" Mode="Value" />
</BaseParams>
<Listeners>
<BeforeLoad Fn="function (store, operation, opts) {
var telecontrolCabecera = #{storeTelecontrolCabecera}.getAllRange()[0];
var idTelecontrol = 0;
if (telecontrolCabecera!=null)
{
idTelecontrol = telecontrolCabecera.json.Cabecera.IdTelecontrol;
}
Ext.apply(operation, {
params: {
Operation: 'GetEventos',
IdTelecontrol: idTelecontrol
}
});
}" />
</Listeners>
</tlf:Storage>
The problem is that when it loads, it fails because the field "Programa" is null, so it can't map it. I want to be able to show the grid anyways.
Also, i have a grid and i want to map it to the store.
If i set recordfield as complex (leaving only "Producto" as the name with no mapping), the DataIndex of the column should be "Producto.Nombre" ?
How can i map a gridpanel to a complex mapped stored?
Last edited by Daniil; Nov 28, 2012 at 2:08 PM.
Reason: [CLOSED]