Javascript/Sencha

Sencha grid 내용 복사 가능하게 설정

바리새인 2025. 1. 18. 08:43

viewConfig를 통해서 설정함
trackOver: false, // Disable row hover effects
enableTextSelection: true // Allow text selection in grid cells

Ext.create('Ext.grid.Panel', {
    title: 'Example Grid',
    store: {
        fields: ['name', 'email', 'phone'],
        data: [
            { name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
            { name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' }
        ]
    },
    columns: [
        { text: 'Name', dataIndex: 'name', flex: 1 },
        { text: 'Email', dataIndex: 'email', flex: 1 },
        { text: 'Phone', dataIndex: 'phone', flex: 1 }
    ],
    viewConfig: {
        trackOver: false, // Disable row hover effects
        enableTextSelection: true // Allow text selection in grid cells
    },
    renderTo: Ext.getBody()
});