如何根据商店数据在一列中呈现不同的图标?

时间:2019-04-11 11:09:18

标签: extjs extjs6.2

我有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)
                }]
            });

请帮助。谢谢

1 个答案:

答案 0 :(得分:0)

经过一些解决方法终于知道了

public class Your_Controller implements IController {

@Override
public void initialize(Activity activity, Bundle savedInstanceState) {
    //do super where needed

    //make one class level Activity instance to work in other methods
     act = activity;

    //just initialize views like below
    TextView tv = (TextView) activity.findViewById(R.id.abc);
}