EXTJS 2.2 EditorGridPanel没有显示发送的数据存储

时间:2015-02-18 20:01:03

标签: extjs

我正在使用EXTJS 2.2我已经使用过EditorGridPanel,当我加载数据存储时,网格不会加载发送的数据。它只是将记录加载为空白。我已经检查了响应JSON并且发送的数据是正确的,它在我的editorgridpanel中没有加载。以下是一些代码:

var debeRecord = Ext.data.Record.create([
    {name: 'name', type: 'string'},
    {name: 'last', type: 'string'},
    {name: 'id', type: 'string'}
    ]);

    var DebeStore = new Ext.data.Store({          
        url: 'clases/TestStore.php',
        fields: ['Name','Last','Id'],
        reader:new Ext.data.JsonReader({
            reader: 'datos',
            totalProperty: 'total',
        },debeRecord),
        listeners:{
            beforeload:function(){
                DebeStore.baseParams.idtransferencia = this.selectednode;
            },
            scope:this
        }           
    });


var cmDebe = [
        {
         id:'col1',
         header:'No.Doc',
         width:380,
         editor: new Ext.form.TextField({allowBlank: true}),
         dataIndex:'Name'
         },
        {
         header:'Last',
         width:380,
         editor: new Ext.form.TextField({allowBlank: true}),
         dataIndex:'Last'
         },
         {
          header:'Id',
          width:380,
          editor: new Ext.form.TextField({allowBlank: true}),
          dataIndex:'Id'
          }
                     ];

//GridPanel del DEBE
     var debeGridPanel = new Ext.grid.EditorGridPanel({
        frame:true,
        disabled:false,
        region:'center',
        id:'debeEditorGrid',
        split: true,
        autoScroll:true,
        title:'Listado de Transferencias (DEBE)',
        cls:'x-toolbar',
        tbar: [btnNewDebe, btnSaveDebe],
        //iconCls:'x-logo',
        autoExpandColumn:'col1',
        clicksToEdit: 1,
        store:DebeStore,
        sm:smDebe,
        loadMask:{
            msg :'Cargando Transferencias...'
        },
        columns: cmDebe,
        bbar: new Ext.PagingToolbar({
            pageSize: 20,
            store: DebeStore,
            displayInfo: true,
            displayMsg: 'Resultados de {0} - {1} de {2}',
            emptyMsg: "No hay resultados para mostrar."
        })
    });

//in the treepanel listeners click: function I load the store
click: function(node, e) {
                    this.selectednode = node.attributes['text'];
                    this.items.items[0].items.items[1].items.items[0].getStore().load({
                        callback: function(){
                            Ext.Msg.show({
                            title: 'Store Load Callback',
                            msg: 'store was loaded, data available for processing',
                            modal: false,
                            icon: Ext.Msg.INFO,
                            buttons: Ext.Msg.OK
                        });
                        }
                    });

0 个答案:

没有答案