1

スクロール可能なグリッドを表示するために Panel を使用しています。私のコードは

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);
                    }
                }
            }    
            ]
        });


高さ属性を使用しない場合、スクリプトは問題ありませんが、この属性で高さを使用すると、スクリプトが停止し、ブラウザーによってメッセージが表示され
ます。または、応答を停止している可能性があります。ここでスクリプトを停止するか、スクリプトが完了するかどうかを確認し続けることができます。

何が問題になる可能性がありますか?

4

1 に答える 1

1

上記のコードは OK です。高さ属性を使用するたびに、幅も指定する必要がありました。

于 2013-10-15T04:42:36.767 に答える