EXT7 textcell与gridcell区别

textcell用于显示纯文本内容,不会从column继承renderer、tpl和formatter

gridcell是grid的默认cell类型

源码

Ext.define('Ext.grid.cell.Cell', {
    extend: 'Ext.grid.cell.Text',
    xtype: 'gridcell',
    ...
    // 与column关联时继承renderer、tpl和formatter
    updateColumn: function(column, oldColumn) {
    	...
    	if (column) {
            tpl = column.getTpl();
            renderer = column.getRenderer();
            formatter = column.getFormatter();

            if (renderer !== null) {
                me.setRenderer(renderer);
                friendly = (typeof renderer === 'function') && renderer.length === 1;
            }

            if (tpl !== null) {
                me.setTpl(tpl);
                friendly = false;
            }

            if (formatter !== null) {
                me.setFormatter(formatter);
            }

            me.friendly = friendly;
       }
   };
   ...

posted on 2022-04-11 22:39  路过君  阅读(28)  评论(0编辑  收藏  举报

导航