始终显示日期选择器中的日历-Angular

时间:2018-07-04 09:44:55

标签: angular datepicker calendar angular-material2

我需要使Angular中的datepicker始终可见。日历将始终可见,而无需依赖按钮(无需单击按钮)

example

源.html

<mat-form-field>
  <input matInput [matDatepicker]="picker" placeholder="Choose a date">
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-datepicker #picker></mat-datepicker>
</mat-form-field>

3 个答案:

答案 0 :(得分:3)

您可以使用import pyspark.sql.functions as f scoresheet.select('name').join( scoresheet .withColumn('score', f.explode('scores')) .withColumn('subject', f.col('score').getField('_1')) .groupBy('name') .agg(f.collect_list('subject').alias('subjects')) , on='name' , how='left' )

mat-calendar

答案 1 :(得分:1)

您可以将opened="true"添加到日期选择器中。

您可以使用如下代码:

<mat-form-field>
  <input matInput [matDatepicker]="picker" placeholder="Choose a date">
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-datepicker class="fixed-open" #picker opened="true"></mat-datepicker>
</mat-form-field>

工作示例:https://stackblitz.com/edit/angular-ysspzm?file=app%2Fdatepicker-overview-example.html

文档:https://material.angular.io/components/datepicker/api

Taken from the documentation

答案 2 :(得分:0)

您可以为此使用<Grid Grid.Row="1" Grid.ColumnSpan="2" Background="Transparent"> <Grid x:Name="AllContentGrid" Background="Transparent" Margin="4,4,4,4" > <ParallaxView Source="{x:Bind MyEditBox}" VerticalShift="250"> <Image x:Name="BackgroundImage" Source="ms-appx:///Assets//Images/ParallaxBackground.jpg" Stretch="UniformToFill"/> </ParallaxView> <RichEditBox x:Name="MyEditBox" IsReadOnly="True" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" RequiresPointer="Never" ScrollViewer.VerticalScrollBarVisibility="Visible" BorderThickness="0" ScrollViewer.VerticalScrollMode="Enabled" Foreground="Black" Padding="40,40,40,20" FontSize="16" Style="{StaticResource MyRichEditBoxStyle}"> </RichEditBox> </Grid> </Grid>

opened="true"