1. #1
    Ext User jvolt's Avatar
    Join Date
    Jan 2008
    Posts
    44
    Vote Rating
    0
    jvolt is on a distinguished road

      0  

    Question grid with ext direct

    grid with ext direct


    How to use Ext Direct with Grid?

    Anyone got a simple example?

    Got that solved by adding:

    Code:
       jsonReader = new Ext.data.JsonReader({
            root: 'list',
            fields: [
                {name: 'chv_cotacao',  type: 'string'}
            ]
        });
    
        mystore = new Ext.data.DirectStore({
            reader: jsonReader,
            paramsAsHash: false,
            paramsNames: {
                d: "d"
            },
            paramOrder: 'd',
            autoLoad: true,
            baseParams: {d: data},
            storeId:'mystore',
            fields: 'chv_cotacao',
            directFn: Cotacao.getCotacoes
        });
    
        estrutura = new Ext.Viewport({
            layout:'border',
            border:false,
            items:[{
                region:'west',
                width: '33%',
                autoScroll:true,
                title:'Cotações',
                bodyStyle:'font-size:11px;',
                margins: '32 5 0 0',
                items:
                new Ext.grid.GridPanel({
                        store: mystore,
                        id: 'gcotacao',
                        columns: [
                            {id:'chv_cotacao', header: 'j', sortable: true, dataIndex: 'chv_cotacao'}
                        ],
                        stripeRows: true,
                        autoHeight: true,
                        border: false
                    })
            },{
                region:'east',
                html:'Informações do cadastro',
                width: '33%',
                autoScroll:true,
                bodyStyle:'padding:5px;font-size:11px;',
                margins: '32 0 0 5',
                title:'Informações do cadastro'
            },{
                region:'center',
                html:'Center',
                width: '33%',
                autoScroll:true,
                bodyStyle:'padding:5px;font-size:11px;',
                margins: '32 0 0 0',
                title:'Informações da cotação'
            }]
        });    
        aguarde.hide();
        Ext.getCmp('gcotacao').on('click', function(sm, index, record){
            getCotacoes('data')
        });
    Last edited by jvolt; 29 Apr 2010 at 12:50 PM. Reason: [SOLVED]