properties of two models are not shown in grid with ExtJS

1

I have two models (Client and Payment) which are one in a third model (Model), but at the moment of linking the data to display them in the grid I have not been able to display the information I have in the two models , the json that returns my method if it gets data.

How can I do to binde or show my registration data? already try placing model. property but it does not work.

    // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        model: 'Modelo.Pagos',
        proxy: {
            pageParam: false, //to remove param "page"
            startParam: false, //to remove param "start"
            limitParam: false, //to remove param "limit"
            noCache: false, //to remove param "_dc"
            //storeId: 'Data',
            // load using HTTP
            type: 'ajax',
            url: 'Home/GetPagosAutorizados',
            // the return will be XML, so lets set up a reader
            reader: {
                type: 'json',
                rootProperty: 'data',
                //record: 'Pagos',
                //record: 'Cliente'
            }
        }
    });
 

    // create the grid
    var grid = Ext.create('Ext.grid.Panel', {        
        bufferedRenderer: false,
        store: store,
        columns: [
            { text: "ID Pago", width: 120, dataIndex: 'Pagos.IdPago', sortable: true },
            { text: "Cliente", flex: 1, dataIndex: 'Cliente.Nombre', sortable: true },
            { text: "Monto", width: 125, dataIndex: 'Monto', sortable: true },
            { text: "Comisión", width: 125, dataIndex: 'Comision', sortable: true },
            { text: "Autorización", width: 125, dataIndex: 'Autorizacion', sortable: true },
            { text: "Comentario", width: 125, dataIndex: 'Comentario', sortable: true },
            { text: "Fecha", width: 125, dataIndex: 'Fecha:date', sortable: true }
        ],
        forceFit: true,
        height: 210,
        split: true,
        region: 'north'
    });

In the reader that is where the store is created, I have

  

record: 'Payments'

and

  

record: 'Client'

when I disable any of the two if I see the data but only the properties that belong to the model that is assigned to record

    
asked by Ivxn 24.07.2018 в 00:15
source

0 answers