简体   繁体   中英

TypeError: b is null extjs4

My app has a grid, on double click on a record a window appear. In this windows there are two tabs, in the first I print a table with all the information of the selected row, in the second tab I have another grid linked with another store that display a sort of "logger" to see the activities of the selected row. My problem is that when I double click on a row the window appears and the activity store is loaded perfectly. But if I close the window and then I double click on another row, the Activity tab is empty and the error is TypeError: b is null .

EDIT: Solved, I created the grid only one time, I have to create the grid everytime I create the window

This is my solution:

Define the activities grid

Ext.define('Beautyeco.actGrid', {
                extend: 'Ext.grid.Panel',

                title: '',
                minHeight: 200,
                maxHeight: 300,
                store: actStore,
                id: 'actGrid',

                initComponent: function() {
                    this.columns = [ //columns ]
                    this.callParent(arguments);
                }
            });

Listener on double click

itemdblclick: function(tablepanel, record, item, index, e, options){
                        // create here the grid
                        var activitiesGrid = Ext.create('Beautyeco.actGrid');

                        var editWindow = new Ext.Window({
                            title: 'Modifica informazioni',
                            width: 600,
                            minHeight: 400,
                            items: [
                                {
                                    xtype: 'tabpanel',
                                    activeTab: 0,
                                    items: [
                                        {
                                            title: 'Info generali',
                                            id: 'infoTab',
                                            width: 600,
                                            tpl: [ //tpl ]
                                        },
                                        {
                                            title: 'Attività',
                                            width: 600,
                                            id: 'actTab',
                                            items: [activitiesGrid] // add the grid
                                         }
                                      ]
                                  }
                              ]
                          });
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM