Browse Source

Merge pull request #1077 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'd3803b497388d7ddf4461c694af1605749734c3e':
  BI-49874 feat: 部件同步同步一下控件中的事件
es6
guy 5 years ago
parent
commit
aa8596f91f
  1. 4
      src/case/button/item.singleselect.radio.js
  2. 41
      src/component/treevaluechooser/combo.listtreevaluechooser.js
  3. 41
      src/component/treevaluechooser/combo.treevaluechooser.insert.js
  4. 41
      src/component/treevaluechooser/combo.treevaluechooser.js
  5. 41
      src/component/valuechooser/combo.valuechooser.js

4
src/case/button/item.singleselect.radio.js

@ -57,7 +57,7 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE, this.isSelected(), this);
this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this);
}
},
@ -68,5 +68,5 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
}
});
BI.SingleSelectItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectRadioItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem);

41
src/component/treevaluechooser/combo.listtreevaluechooser.js

@ -29,11 +29,38 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
});
this.combo.on(BI.MultiTreeListCombo.EVENT_CONFIRM, function () {
height: o.height,
listeners: [{
eventName: BI.MultiTreeListCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM);
}
}]
});
},
@ -50,5 +77,11 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser,
this.combo.populate.apply(this.combo, arguments);
}
});
BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ListTreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ListTreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.list_tree_value_chooser_insert_combo", BI.ListTreeValueChooserInsertCombo);

41
src/component/treevaluechooser/combo.treevaluechooser.insert.js

@ -29,11 +29,38 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
});
this.combo.on(BI.MultiTreeInsertCombo.EVENT_CONFIRM, function () {
height: o.height,
listeners: [{
eventName: BI.MultiTreeInsertCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM);
}
}]
});
},
@ -50,5 +77,11 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.TreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.TreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.TreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.TreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.tree_value_chooser_insert_combo", BI.TreeValueChooserInsertCombo);

41
src/component/treevaluechooser/combo.treevaluechooser.js

@ -29,11 +29,38 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
});
this.combo.on(BI.MultiTreeCombo.EVENT_CONFIRM, function () {
height: o.height,
listeners: [{
eventName: BI.MultiTreeCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM);
}
}]
});
},
@ -50,5 +77,11 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.TreeValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TreeValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";
BI.TreeValueChooserCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo);

41
src/component/valuechooser/combo.valuechooser.js

@ -32,11 +32,38 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
height: o.height,
listeners: [{
eventName: BI.MultiSelectCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_CONFIRM);
}
}]
});
},
@ -58,5 +85,11 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
this.combo.populate.apply(this, arguments);
}
});
BI.ValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ValueChooserCombo.EVENT_STOP = "EVENT_STOP";
BI.ValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.value_chooser_combo", BI.ValueChooserCombo);
Loading…
Cancel
Save