根据在文本控件

时间:2017-04-13 16:17:19

标签: asp.net-mvc kendo-ui kendo-asp.net-mvc kendo-datepicker

我正在研究MVC应用程序。尝试根据文本框控件的更改事件向Kendo MVC Datetimepicker控件添加月份 当用户在“合同期限”字段中输入月份时,应添加“优先日期时间”控件。

有人可以建议如何做到这一点。

enter image description here

以月为单位的合约期限

  <div class="form-group">
                    @Html.LabelFor(model => model.ContractDurationInMonths, htmlAttributes: new { @class = "control-label col-md-4" })
                    <div class="col-md-8">
                        @Html.EditorFor(model => model.ContractDurationInMonths, new { htmlAttributes = new { @class = "form-control", style = "width:100%" } })
                        @Html.ValidationMessageFor(model => model.ContractDurationInMonths, "", new { @class = "text-danger" })
                    </div>
                </div>

优先日期时间控制

<div class="form-group">
                    @Html.LabelFor(model => model.Priority, htmlAttributes: new { @class = "control-label col-md-4" })
                    <div class="col-md-8">
                        @*@Html.EditorFor(model => model.Priority, new { htmlAttributes = new { @class = "form-control" } })*@
                        @(Html.Kendo().DatePickerFor(model => model.Priority)
                          .Name("Priority")
                          .Value("10/10/2011")
                          .HtmlAttributes(new { style = "width: 100%" })
                        )
                        @Html.ValidationMessageFor(model => model.Priority, "", new { @class = "text-danger" })
                    </div>
                </div>

1 个答案:

答案 0 :(得分:0)

基本上,在文本框上设置blur()事件,然后更新datepicker的值:

DCL = df['date','value'].groupby(['date'])['value'].quantile(.1)
...
2017-01-26   0.067924
2017-01-27   0.067719
2017-01-30   0.068561
2017-01-31   0.068056
2017-02-01   0.067988
2017-02-02   0.068306
2017-02-03   0.068311
2017-02-06   0.067923
2017-02-07   0.067192
2017-02-08   0.066902
2017-02-09   0.065978
2017-02-10   0.065414
2017-02-13   0.065402
2017-02-14   0.065939
2017-02-15   0.065519

以下是js中的示例:http://dojo.telerik.com/@sg53719/eseRo