mercredi 20 juillet 2016

How to hide/show checkbox in SmartFilterBar

I'm trying to hide/show one checkbox after first one is selected in SmartFilterBar in SAPUI5. It should be changing of property but I cannot figure out the correct code. This is code in my XML inside SmartFilterBar:

<smartFilterBar:ControlConfiguration key="checkbox1" label="{i18n>Processingwithoutdialog}" visibleInAdvancedArea="true" >
<smartFilterBar:customControl> 
<CheckBox />
</smartFilterBar:customControl> 
</smartFilterBar:ControlConfiguration> 
<smartFilterBar:ControlConfiguration key="checkbox4" label="{i18n>Restrictedprotocol}" visibleInAdvancedArea="true">
<smartFilterBar:customControl> 
<CheckBox editable="false"/>
</smartFilterBar:customControl> 

And my code in controller.js:

onBeforeRebindTable: function(oEvent) {
       var oSmartTable = oEvent.getSource();  
       var oSmartFilterBar = this.byId(oSmartTable.getSmartFilterId()); 
       var oCustom = oSmartFilterBar.getControlByKey("checkbox1").getChecked;
       var oCustom2 = oSmartFilterBar.getControlByKey("checkbox4");
       oCustom.onchange = function() {
          oCustom2.editable = this.checked ? false : true;
       }      

},




Aucun commentaire:

Enregistrer un commentaire