material ui : reactjs: TextField: Multiline: How to show minimum number of rows and after than no scroll - material-ui

In material ui Texfield for multiline. I want to show a minimum 3 rows in the beginning and there up expand the text area. I dont want to show scroll if the rows exceed 3
I tried this
<TextField
id="outlined-multiline-static"
label="Multiline"
multiline
rows={3}
defaultValue="Default Value"
variant="outlined"
/>
What is see is
HOw to set min rows.

To increase the height, instead of showing scroll you can make use of maxRows prop instead. so the scroll would be added after the maxRows are reached
https://codesandbox.io/s/material-demo-forked-ccchw
<TextField
id="outlined-multiline-static"
label="Multiline"
multiline
rows={3}
defaultValue="1"
maxRows={10}
variant="outlined"
/>

Add minRows to the TextField component
<TextField
id="outlined-multiline-static"
label="Multiline"
multiline
rows={3}
defaultValue="Default Value"
variant="outlined"
maxRows={3}
/>

Related

.NET MAUI How to set CollectionView items Padding to 0

I can't set padding to 0 in items of CollectionView in MAUI.
In this example, I use Data and Data[i].Color as follow:
<CollectionView
ItemsSource="{Binding Data}"
ItemSizingStrategy="MeasureFirstItem"
ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate>
<DataTemplate>
<Button
Clicked="Button_Clicked"
WidthRequest="10"
HeightRequest="10"
BackgroundColor="{Binding Color}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
My Buttons has Width 10 and Height 10, and there is space between my Buttons. Only set Button Width more than 100 can I see no space between my Buttons, but 100 is too large.
I tried to set Padding or Margin in Button, and WidthRequest in CollectionView, but it didn't work.
How can I remove the space?
I tried ItemSpacing:
<CollectionView.ItemsLayout>
<LinearItemsLayout
Orientation="horizonal"
ItemSpacing="0" />
</CollectionView.ItemsLayout>
But fail.
You want to set the space between buttons to 0 in CollectionView. And this is a known issue and it's been tracked in Windows CollectionView ItemSpacing is not working. When setting the property ItemSpacing to 0, the space between the items should have been reduced to 0, however it doesn't work as expected.
For more details, you can refer to MAUI: How to reduce spacing between buttons.

How can I offset a MUI Popover component from an anchorEl?

With anchorOrigin, I can give a MUI Popover an offset with anchorPosition.top and anchorPosition.left. But this has no effect when I'm using an anchorEl (i.e., attaching the popover to a trigger element), not an anchorOrigin (i.e., using absolute positioning).
It seems I can do this with the MUI Popper
(see this issue), but not very easily with the popover. I want the clickaway functionality so apart from this positioning difficulty I prefer the popover.
What's the best way to attach to an element but shift the popover (say, down and right)?
You can just pass a number to the horizontal and vertical properties to have them offset with respect to the top-left corner of the anchor element, like this:
<Popover
id={id}
open={open}
anchorEl={anchorEl}
onClose={handleClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 100,
}}
>
<Typography sx={{ p: 2 }}>The content of the Popover.</Typography>
</Popover>
this will open the popover 100 pixels to the right of the left margin of the anchorEl.

Alignment of injected buttons on sap.m.table

I have a table (sap.m.table) and am using the delete table mode (mode="Delete") and am also including the edit feature by setting the ColumnListItem type to (type="DetailAndActive")
<Table id="usersTable" mode="Delete"
...
<ColumnListItem type="DetailAndActive" vAlign="Middle" detailPress="onEdit" highlight="{= ${users>EmailConfirmed} === true ? 'None' : 'Error'}">
I have 2 lines per row as I have an objectidentifier as 1 of the cells:
<ObjectIdentifier title="{users>Email}" text="last: {path: 'users>LastLoggedOnUtcDate', formatter: '.formatDateTime'}"/>
When displaying I get the following outcome:
The button alignment is out - the edit button is vertically aligned at the top while the delete button is vertically aligned in the center.
As you can see I have set vAlign to Middle on the ColumnListItem.
I would appreciate any help for aligning the edit button in the center too?
Thanks!

Opacity toggle three (or more) DIV

<div id="rotator">
<p id="1">Some Text 1</p>
<p id="1">Some Text 2</p>
<p id="1">Some Text 3</p>
</div>
They are presented in a row. All I want is automatically cycle the three text by toggling opacity, ie. at first text 1 is opacity 1, and test 2 and 3 are opacity .5. Then after 5 seconds or so, text 2 is opacity 1, and text 1 and three are opacity .5... so on in a cycle.
Can someone give me a hint/direction on how to do this in jquery please. Thank you in advance.

Using variables in Conditional Style

I have a Title band with a Text Field containing a calculated Variable $V{avg_perc}. The Text Field has the evaluationTime set to Report, same for the Variables resetType.
Now I'm trying to set the background color of this field with a Conditional Style but I keep getting an error message saying something like:
Invalid expression: !Double.isNaN($V{avg_perc}) && $V{avg_perc} >= 0.8
I'm doing exactly the same thing with the same Conditional Style in the Column Footer and it works without any problems, even if I set the evaluationTime for this field to Report too.
After removing !Double.isNaN($V{avg_perc}) I don't get an error anymore but the expression still doesn't work. My field stays red which is the basic color when none of the conditions is valid, no matter which value $V{avg_perc} has. It still works in the Column Footer, though. This is my style:
<style name="avg_color" mode="Opaque" backcolor="#FF0000" pdfFontName="Helvetica-Bold">
<conditionalStyle>
<conditionExpression><![CDATA[$V{avg_perc} >= 0.8]]></conditionExpression>
<style backcolor="#008000"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$V{avg_perc} >= 0.6 && $V{avg_perc} < 0.8]]></conditionExpression>
<style backcolor="#FFCC00"/>
</conditionalStyle>
</style>
Used Fields and Variables for this:
<field name="perc" class="java.lang.Double"/>
<variable name="avg_perc" class="java.lang.Double" calculation="Average">
<variableExpression><![CDATA[$F{perc}]]></variableExpression>
</variable>
Any idea how to get this thing to work? I'm using JasperReports and iReport in version 3.7.4.
I finally found the solution for my problem. Adding
<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/>
at the report level causes a Conditional Style to be performed at the moment at which the element is evaluated.
See this answer in the Jaspersoft Community for more information.
in your view ireport designer.
click on the field and in the properties panel.: markup = styled selected
Right click on the fied. edit expression:
($F{fila1}.equals("c") ? "<style forecolor='red'>"+ $F{fila1}+"</style>" : $F{fila1})
or xml
<textFieldExpression><![CDATA[($F{fila1}.equals("c") ? "<style forecolor='red'>"+ $F{fila1}+"</style>" : $F{fila1})]]></textFieldExpression>
Modify this code based on your requirement
<style name="alternateStyle" fontName="Arial">
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{AMOUNT}.intValue() == 0)]]></conditionExpression>
<style mode="Opaque" backcolor="#FF0000" isBold="true"/>
</conditionalStyle>
</style>
And also refer this link : Link