1

I am using a Panel to show the scrollable grid. My code is

var resultsPanel = Ext.create('Ext.panel.Panel', {
height:140,
items: companyView,
renderTo: 'addTable'+i,
layout: 'fit'
});

var checkbox = new Ext.selection.CheckboxModel();
companyView = Ext.create('Ext.grid.Panel', {
    title:'',
    selModel: checkbox,
    id:'companylist'+i,
    store: store1,
    multiSelect: true,
    viewConfig: { emptyText: 'No data to display'},
    columns:[
                {header: 'Type', width: 80, flex: 1, dataIndex: 'type',
                renderer: sample},
                {header: '%', width: 30, flex: 1, dataIndex: 'per'},
                {header: 'Name', width: 30, flex: 1, dataIndex: 'name',renderer:functOwnerNameCmp},
                {header: 'O.%', width: 50, flex: 1, dataIndex: 'owner'},
                {header: 'Role', width: 30, flex: 1, dataIndex: 'role'},
                {header: 'Gender', width: 50, flex: 1, dataIndex: 'gender'}
            ],
    tbar  : [
                {
                    text: 'Delete Selected',
                    margins: '0 0 0 290',
                    handler: function() 
                    {
                        rowsSelected = companyView.getSelectionModel().getSelection();
                        if(rowsSelected.length==0) {
                            Ext.Msg.alert(' ', 'Please select one record');
                        } else {
                            Ext.MessageBox.confirm(' ', 'Are you sure you want to remove Person?',confirmRemoveAffCmpRec);
                    }
                }
            }    
            ]
        });

If I don't use the height attribute, the script is ok but if I use height in this attribute the script gets stopped and the message is shown by the browser for eg in Mozilla-
Unresponsive Script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

What can be the problem?

4

1 回答 1

1

上面的代码是好的,我只需要在使用 height 属性时也指定宽度。

于 2013-10-15T04:42:36.767 回答