diff --git a/zero.Web.UI/app/core/list-column.ts b/zero.Web.UI/app/core/list-column.ts index d3446e77..a0d0e542 100644 --- a/zero.Web.UI/app/core/list-column.ts +++ b/zero.Web.UI/app/core/list-column.ts @@ -174,17 +174,21 @@ class ListColumn /** * Output a boolean value by displaying a checkmark - * @param {object} [options] - Custom options + * @param {function} [isTrueFunc] - Decide if this boolean is true based on a function with the value as a parameter * @returns {ListColumn} */ - boolean(options) + boolean(isTrueFunc) { this._type = 'boolean'; this._asHtml = true; - this._funcOptions = { ...options }; - this._func = (value, opts) => ` - - `; + this._funcOptions = { isTrueFunc }; + this._func = (value, opts) => + { + let isTrue = typeof opts.isTrueFunc === 'function' ? !!opts.isTrueFunc(value) : !!value; + return ` + + `; + } return this; }