view.xml
<smartFilterBar:ControlConfiguration key="Action " label="移动方式:" mandatory="mandatory" visibleInAdvancedArea="true">
<smartFilterBar:customControl>
<RadioButtonGroup id="groupA" columns="2" customData:hasValue="true" select="onRadioButtonSelect">
<RadioButton text="生产转科研" selected="true"/>
<RadioButton text="科研转生产"/>
</RadioButtonGroup>
</smartFilterBar:customControl>
</smartFilterBar:ControlConfiguration>
同时smarttable添加beforeRebindTable="onBeforeRebindTable"属性 。
controller.js
onBeforeRebindTable: function(oEvent) {
var mBindingParams = oEvent.getParameter("bindingParams"),
aCustomRadio = this._oCustomRadio.getSelectedIndex() + 1;
mBindingParams.filters.push(
new Filter(
"Action",
FilterOperator.EQ,
aCustomRadio.toString()
)
);
},
该事件在smarttable完成绑定之前触发。