定位日期选择器按钮

问题描述 投票:0回答:1

我正在开发使用ASP.Net和jQuery我的网站。我使用的是每月选取器控件。我希望把旁边的按钮,输入显示的日期。谁能帮我?

<div class="col-lg-3">
  @Html.TextBox("IconDemo", DateTime.Today.ToString("MM/yyyy"), new { @id = "IconDemo", @class = "Default form-control form-control-sm", @readonly = true })
</div>
$("#IconDemo").MonthPicker({
  Button: "<button id='btmonthpicker' class='btn btn-warning btn-sm' ><i class='fa fa-calendar'></i></button>",
  Position: {
    collision: 'fit',
    at: 'left top',
    my: 'left bottom',
    of: $('#IconDemo')
  },
  format: "mm-yy",
  startView: "months",
  minViewMode: "months",
  MaxMonth: 0,
  MaxYear: 0,
});

enter image description here

jquery asp.net-mvc jquery-ui jquery-ui-datepicker
1个回答
0
投票

我找到这个问题的解决方案

<div class="col-lg-3">
  <div class="pull-right">
  @Html.TextBox("IconDemo", DateTime.Today.ToString("MM/yyyy"), new { @id = "IconDemo", @class = "Default form-control form-control-sm", @readonly = true })
</div>
</div>

它只是添加类上拉右包含日期选择器在div

© www.soinside.com 2019 - 2024. All rights reserved.