snapshift / Ext.ux.grid.Printer

An Extjs 5/6/7 Component to print grid content
6 stars 5 forks source link

add support for custom boolean column #7

Open abenhamdine opened 7 years ago

abenhamdine commented 7 years ago

In one application, we use a custom ux boolean column which modifies tdCls to display fontawesome icons for boolean values :

defaultRenderer: function(value, metaData) {

            var customCls = '';
            var ret = '';

            if (value === true) {
                customCls = 'arh-grid-col-boolean-td-true';
                ret = this.trueText;
            } else if (value === false) {
                customCls = 'arh-grid-col-boolean-td-false';
                if (this.arhDisplayGlyphForFalseValue) {
                    ret = this.falseText;
                } else {
                    ret = '';
                }
            } else {
                if (this.arhDistinctNull) {
                    customCls = 'arh-grid-col-boolean-td-null';
                    ret = this.undefinedText;
                } else {
                    customCls = 'arh-grid-col-boolean-td-false';
                    if (this.arhDisplayGlyphForFalseValue) {
                        ret = this.falseText;
                    } else {
                        ret = '';
                    }
                }
            }

            metaData.tdCls = customCls;

            return ret;

        }

currently nothing is displayed in print view : grid : image

print preview : image

abenhamdine commented 2 years ago

add a helper getHtmlForPrint() in grid column ? other possible name : printRenderer()