Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
984 views
in Technique[技术] by (71.8m points)

sapui5 - Expand input suggestion width

Screenshot of the current width:
enter image description here

I'm trying to expand the suggestion popup above.

Since I want to use it in a FilterBar, the Input fields are small and the Table becomes kind of useless. When trying to change the width with the Inspector, it changes back immediately.

The demo code I'm using is rather simple.

<Input xmlns="sap.m"
  showSuggestion="true"
  showTableSuggestionValueHelp="false"
  suggestionRows="{/ZSD_DebiaSet}"
  width="200px">
  <suggestionColumns>
    <Column popinDisplay="Inline" demandPopin="true">
      <Label text="Name"/>
    </Column>
    <Column hAlign="Center" popinDisplay="Inline" demandPopin="true" minScreenWidth="Tablet">
      <Label text="Product ID"/>
    </Column>
    <Column hAlign="Center" popinDisplay="Inline" minScreenWidth="Tablet">
      <Label text="Supplier Name"/>
    </Column>
    <Column hAlign="End" popinDisplay="Inline" demandPopin="true">
      <Label text="Price"/>
    </Column>
  </suggestionColumns>
  <suggestionRows>
    <ColumnListItem>
      <!-- ... -->
    </ColumnListItem>
  </suggestionRows>
</Input>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Controls extended from sap.m.Input (i.e. including sap.m.MultiInput) have a property called maxSuggestionWidth which will let you have a wider suggestion table than the actual width of your input. Check the property here: https://openui5.hana.ondemand.com/api/sap.m.Input#methods/setMaxSuggestionWidth

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field.

Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

I added this property with value 500px (just for testing) and the result is the following (The Input width is 200px):

enter image description here

I think this is what you are looking for ^^ Hope it helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...