0
votes

I'm creating a Window with ExtJS 4 by clicking actioncolumn icon with code:

{
        xtype:'actioncolumn',
        width: 20,
        items: [
            {
                tooltip: 'Log',
                icon: '/img/details.gif',
                handler: function(grid, rowIndex) {

                    var store = grid.getStore();

                    var record = store.getAt(rowIndex);

                    var ba = Ext.createByAlias('widget.ba');

                    ba.setTitle(ba.title + record.get('name'));

                    ba.down('grid').getStore().load({
                        params:{
                            id: record.get('id'),
                        },
                    });

                    ba.show();

                },

            },
        ]
    },

My window has "closeAction: 'destroy'":

Ext.define('BB.view.Ba', {

    extend: 'Ext.window.Window',
    alias: 'widget.ba',
    title: 'Log ',
    layout: 'fit',
    width: 500,
    closeAction: 'destroy',
    items: {
            xtype: 'gridpanel',
            store: 'Bas',
            selType: 'rowmodel',
            columns: [
                {
                    dataIndex: 'order_id',
                    width: 60,
                    text: 'order id',
                }, {
                    dataIndex: 'time',
                    width: 100,
                    text: 'time',
                }, {
                    dataIndex: 'summ',
                    width: 80,
                    text: 'summ',
                    renderer: function(value) {
                        return value.toFixed(2); 
                    },
                }, {
                    dataIndex: 'comment',
                    width: 220,
                    text: 'comment',
                },
            ],
            //bbar: Ext.createByAlias('widget.paging'),           

        },



});

As you can see Window is invoked by alias name 'widget.ba'.

So, when I click actioncolumn icon for the first time everithing goes well, but if i close that window (clicking close "cross" on the top right of the window) and click actioncolumn icon again i see "Uncaught TypeError: Cannot read property 'style' of undefined" in the Console log and it is thrown on "ba.show();" line of the script. Window is not showing, but after other click on icon window renders, but it is no actally a WIndow, it's rendered as simple panel to the Viewport.

Why if "closeAction" is set to "destroy" there is such a prjblem?

Thanks.

1

1 Answers

0
votes

I've found the problem. Window was rendered in viewport because of very long grid which was moving bottom part of Viewport down.