Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

sap.m.Select popover expanding upwards (I want it to go down)

$
0
0

Hello,

 

I was working with the sap.m.Select class and when I click on the expand arrow on the select in my ui, the popover prefers to expand upwards rather than downwards (it does expand downwards when there isn't a sufficient amount of space above it). What I want is for it to prefer to expand downwards. I was taking a look at the Select-dbg.js file and I found the _createPopover function, which looks like so:

 

Select.prototype._createPopover = function() {

 

 

       var that = this,

            oPicker = new Popover({

            showArrow: false,

            showHeader: false,

            placement: sap.m.PlacementType.Vertical,

            offsetX: 0,

            offsetY: 0,

            initialFocus: this,

            bounce: false

       });

 

      // detect when the scrollbar is pressed

       oPicker.addEventDelegate({

            ontouchstart: function(oEvent) {

                 var oPickerDomRef = this.getDomRef("cont");

 

                 if (oEvent.target === oPickerDomRef) {

                      that._bProcessChange = false;

                 }

            }

  }, oPicker);

 

  this._decoratePopover(oPicker);

  return oPicker;

};

 

The thing I want to change above this _createPopover function is the placement property. By default it is set to sap.m.PlacementType.Vertical, what I would like is for it to be set to sap.m.PlacementType.VerticalPreferedBottom (the PlacementType property that corresponds with my desired behaviour). However, I do not know how to override functions of classes that are part of the ui5 library. How would I go about overriding this function to what I would like it to be and is it a good idea doing so? If not, what are the alternatives?

 

Jitin Dodd


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>