Ask how to set the ExtJs table item width.

Asked 2 years ago, Updated 2 years ago, 25 views

I want to set the width of each of the items in the table and use it. I want to use columns, but I want to adjust the width only.

 layout: {
                     type: 'table',
                     columns : '3',
                 },
                 items : [
                  {
                    xtype : 'textfield' ,
                    margin : '5',
                                   }
                                ,
                                  {
                    xtype : 'textfield' ,
                    margin : '5',
                                   }
                                    ,
                                    {
                    xtype : 'textfield' ,
                    margin : '5',
                                    }

javascript

2022-09-22 22:11

1 Answers

How about using a grid instead of a table?

Using Grid, you can give the width of each column as follows when drawing as shown in the image above.

Ext.create('Ext.grid.Panel', {
    renderTo: document.body,
    store: userStore,
    width: 400,
    height: 200,
    title: 'Application Users',
    columns: [
        {
            text: 'Name',
            width: 100,
            sortable: false,
            hideable: false,
            dataIndex: 'name'
        },
        {
            text: 'Email Address',
            width: 150,
            dataIndex: 'email',
            hidden: true
        },
        {
            text: 'Phone Number',
            flex: 1,
            dataIndex: 'phone'
        }
    ]
});

Source: https://docs.sencha.com/extjs/6.0/components/grids.html


2022-09-22 22:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.