JSRender-如何显示日历图标并使日期选择器字段为只读 [英] JSRender- How to display calendar icon and make date picker field read only

查看:161
本文介绍了JSRender-如何显示日历图标并使日期选择器字段为只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在模板中使用以下代码进行日期选择.

I am using the following code for datepicke in my template.

{^{datepicker fromValue readonly="true" class="myclass"/}}

{^{datepicker toValue ^_minDate=fromValue class="myclass" readonly icon="show"/}}

我试图实现以下目标.

  1. 我想使datepicker字段为只读.对于上面的代码,它没有发生.
  2. 如何在文本框中显示日历图标.目前还没有发生. icon = show ...我尝试过了.我什么都没看见.
  3. 就我而言,我必须同时显示toDate和FromDate.如果用户首先选择toValue并从value返回到,则如何限制其最大日期.当前它不限制用户.因此,我可以选择大于日期的日期.

谢谢.

推荐答案

对于只读日期选择器,它必须位于div上并具有_disabled=true.如果不是div,则设置_disabled=true将禁用输入,因此日期选择器将不会显示.

For a readonly datepicker, it needs to be on a div, and have _disabled=true. If it is not a div the setting _disabled=true will disable the input, so the datepicker won't show.

{^{datepicker startDate elem="div" _disabled=true/}}

{^{datepicker startDate elem="div" _disabled=true/}}

提供图标:

{^{datepicker startDate
  _showOn= "button"
  _buttonImage="https://jqueryui.com/resources/demos/datepicker/images/calendar.gif"
  _buttonImageOnly= true
  _buttonText= "Select date"
/}}

有关开始和结束日期,请参见 http://www.jsviews. com/#samples/tag-controls/datepicker/simple

For start and end date, see http://www.jsviews.com/#samples/tag-controls/datepicker/simple

{^{datepicker startDate
  ^_maxDate=endDate
/}}

{^{datepicker endDate
  ^_minDate=startDate
/}}

这篇关于JSRender-如何显示日历图标并使日期选择器字段为只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆