Results 1 to 4 of 4

Thread: Grid column renderer issue

  1. #1
    Sencha Premium User
    Join Date
    Jun 2009
    Location
    Fort Lauderdale
    Posts
    31

    Default Grid column renderer issue

    Hi;

    I am using the following code in my column renderer function (this is a boolean column). The problem I have is that when the value of the column is TRUE all works well, however when the value is FALSE the image is not displayed? The console log is written as expected which makes me believe my JavaScript is correct, also by switching around the CSS values the image is rendered when value is true as expected, so I conclude no issues with my CSS.

    I am a little confused and any pointers or suggestions would be welcomed.

    thanks,

    -Allen

    Code:
                            {                            xtype: 'gridcolumn',
                                renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
                                    if (value === true) {
                                        metaData.tdCls = 'vcardAddl';
                                        console.log('vcardAddl');
                                    } else {
                                        metaData.tcCls = 'vcardDel';
                                        console.log('vcardDel');
                                    }
                                    return '';
                                },
                                width: 55,
                                align: 'center',
                                dataIndex: 'active',
                                hideable: false,
                                text: 'Active'
                            },
    and my CSS
    Code:
    .vcardAddl {
        background: url(/wDesk/resources/images/btn/vcard-add.png) center no-repeat !important;
    }
    .vcardDel {
        background: url(/wDesk/resources/images/btn/vcard-delete.png) center no-repeat !important;
    }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410

    Default

    Typo:

    Code:
    metaData.tcCls = 'vcardDel';
    Should be tdCls

  3. #3

    Default

    I have some resize problem with grid. I have set grid auto fill as true ,still my columns are not getting resized. Any clue?

  4. #4
    Sencha Premium User
    Join Date
    Jun 2009
    Location
    Fort Lauderdale
    Posts
    31

    Default

    Scott, thanks you identified my issue.

    satya-its,

    I have made my columns a fixed width and have a horizontal scroller,
    my grid is declared as follows
    Code:
                    {                    xtype: 'gridpanel',
                        height: 562,
                        id: 'listMemberGridID',
                        autoScroll: true,
                        store: 'ListMembersStore',
                        listeners: {
                            selectionchange: {
                                fn: me.onGridpanelSelectionChange,
                                scope: me
                            }
                        },
                        columns: [
                            {
                                xtype: 'numbercolumn',
                                hidden: true,
                                dataIndex: 'idsubscriber',
                                hideable: false,
                                text: 'Idsubscriber'
                            },
                            {
                                xtype: 'gridcolumn',
                                renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
                                    if (value === true) {
                                        metaData.tdCls = 'vcardAddl';
                                        console.log('vcardAddl');
                                    } else {
                                        metaData.tdCls = 'vcardDel';
                                        console.log('vcardDel');
                                    }
                                    return '';
                                },
                                width: 55,
                                align: 'center',
                                dataIndex: 'active',
                                hideable: false,
                                text: 'Active'
    
                            },
    ........
    });


    Sorry I cant specifically address your issue.

    -Allen

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •