EXT7 textcell与gridcell区别

2020-06-19 16:47:36 浏览数 (1)

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

gridcell是grid的默认cell类型

源码

代码语言:javascript复制
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;
       }
   };
   ...

0 人点赞