定位日期选择器按钮
Positioning datepicker button
我正在使用 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,
});
我找到了这个问题的解决方案
<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>
只是将 class 右拉添加到包含日期选择器
的 div
我正在使用 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,
});
我找到了这个问题的解决方案
<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>
只是将 class 右拉添加到包含日期选择器
的 div