diff --git a/zero.Web.UI/app/core/list-column.ts b/zero.Web.UI/app/core/list-column.ts index f372c5d7..ba96d609 100644 --- a/zero.Web.UI/app/core/list-column.ts +++ b/zero.Web.UI/app/core/list-column.ts @@ -174,6 +174,31 @@ class ListColumn } + /** + * Outputs an icon + * @param {string} [icon] - Fixed icon name + * @param {string} [size=17] - Size of the icon + * @returns {ListColumn} + */ + icon(icon, size) + { + size = size || 17; + this.#type = 'icon'; + this.#asHtml = true; + this.#func = (value, opts) => + { + let ico = (icon || value).trim(); + let html = ``; + if (ico.indexOf('flag') !== 0) + { + html += ``; + } + return html + ``; + }; + return this; + } + + /** * Shortcut for text() with predefined label and class * @returns {ListColumn}