0

我有 2 个图标需要根据我在同一列中的网格数据显示。

尝试使用 this.store.on('load', function(){... 但不知道如何让它工作

columns.push({
                xtype: 'actioncolumn',
                menuText: t('compare_version'),
                width: 35,
                items: [{
                tooltip: t('icon_compare_version'),
                icon: "/bundles/pimcoreadmin/img/flat-color-icons/info.svg",
                handler: this.compareVersion.bind(this),
                renderer: function(test, test1, test2){
                    return test;
                }
            }]
            });

            columns.push({
                xtype: 'actioncolumn',
                menuText: t('compare_image_version'),
                width: 35,
                items: [{
                    tooltip: t('icon_compare_image_version'),
                    icon: "/bundles/pimcoreadmin/img/flat-color-icons/picture.svg",
                    handler: this.compareImageVersion.bind(this)
                }]
            });

请帮忙。谢谢

4

1 回答 1

0

经过一些解决方法终于得到它

columns.push({
                xtype: 'actioncolumn',
                width: 35,
                dataIndex: 'objType',
                renderer: function (value, rowIndex, record) {
                    if (value == 'object') {
                        rowIndex.tdCls = 'icon'
                    }
                    else{
                        rowIndex.tdCls = 'img'
                    }
                },
                items: [{
                    tooltip: t('icon_compare_version'),
                    icon: "/bundles/pimcoreadmin/img/flat-color-icons/info.svg",
                    handler: this.compareVersion.bind(this),
                    iconCls: 'compare-v'
                },
                {
                    tooltip: t('icon_compare_image_version'),
                    id:'compare-i',
                    icon: "/bundles/pimcoreadmin/img/flat-color-icons/picture.svg",
                    handler: this.compareImageVersion.bind(this),
                    iconCls: 'compare-i'
                }]
            });
于 2019-04-11T11:25:41.413 回答