diff --git a/src/components/utils/ObjectUtils.js b/src/components/utils/ObjectUtils.js index d410184a1..425d4cec1 100755 --- a/src/components/utils/ObjectUtils.js +++ b/src/components/utils/ObjectUtils.js @@ -58,23 +58,29 @@ export default class ObjectUtils { } static resolveFieldData(data, field) { - if (data && field) { - if (field.indexOf('.') === -1) { - return data[field]; - } - else { - let fields = field.split('.'); - let value = data; - for (var i = 0, len = fields.length; i < len; ++i) { - value = value[fields[i]]; - } - return value; - } + if (typeof field === 'function') { + return field(data); } else { - return null; + if (data && field) { + if (field.indexOf('.') === -1) { + return data[field]; + } + else { + let fields = field.split('.'); + let value = data; + for (var i = 0, len = fields.length; i < len; ++i) { + value = value[fields[i]]; + } + return value; + } + } + else { + return null; + } } } + static filter(value, fields, filterValue) { var filteredItems = [];