fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

8 years ago
/**
* guy
*
* @class BI.HighlightBehavior
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
8 years ago
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
8 years ago
},
8 years ago
_init: function () {
8 years ago
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
8 years ago
doBehavior: function (items) {
8 years ago
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
8 years ago
BI.each(items, function (i, item) {
if (item instanceof BI.Single) {
var rule = o.rule(item.getValue(), item);
7 years ago
function doBe (run) {
8 years ago
if (run === true) {
item.doHighLight && item.doHighLight.apply(item, args);
8 years ago
} else {
item.unHighLight && item.unHighLight.apply(item, args);
8 years ago
}
}
if (BI.isFunction(rule)) {
rule(doBe);
8 years ago
} else {
8 years ago
doBe(rule);
8 years ago
}
} else {
item.doBehavior && item.doBehavior.apply(item, args);
8 years ago
}
7 years ago
});
8 years ago
}
});