1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    227
    Vote Rating
    2
    nicolabaldo is on a distinguished road

      0  

    Default align cell grid

    align cell grid


    I need to set cell alignment inside a grid.
    Is it possible to add a class??

    Example:

    COL1 COL2
    value value
    value
    (with align left)
    value
    (with align center)

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,636
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if the following works:

    Code:
    .price-fall .x-grid-cell-inner {
        text-align:right !important;
    }
    .price-rise .x-grid-cell-inner {
        text-align:center !important;
    }​
    
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'change'],
        data:{'items':[
            { 'name': 'Lisa',  "email":"lisa@simpsons.com",  "change":100  },
            { 'name': 'Bart', "email":"bart@simpsons.com", "change":-20  },
            { 'name': 'Homer', "email":"home@simpsons.com",  "change":23   },
            { 'name': 'Marge', "email":"marge@simpsons.com", "change":-11   }
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            { header: 'Name',  dataIndex: 'name' },
            { header: 'Email', dataIndex: 'email', flex: 1 },
            { header: 'Change', dataIndex: 'change', tdCls: 'x-change-cell' }
        ],
        height: 200,
        width: 400,
        viewConfig: {
            getRowClass: function(record, index) {
                var c = record.get('change');
                if (c < 0) {
                    return 'price-fall';
                } else if (c > 0) {
                    return 'price-rise';
                }
            }
        },
        renderTo: Ext.getBody()
    });​
    Regards,
    Scott.

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    227
    Vote Rating
    2
    nicolabaldo is on a distinguished road

      0  

    Default


    OK thanks!!

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    1
    zzhouag is on a distinguished road

      0  

    Default


    seems it works in same column, but not in same row?

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar