2007-11-06
ROR中关于Calendar的使用
关键字: jsCalendar
ror中可以很方便的使用与jsCalendar一样的控件:
该网页的地址http://dry.4thebusiness.com/info/dhtml_calendar
1、在工程文件的根目录下运行下面的更新
2、在.rhtml文件中置入:
这样就可以使用Calendar控件了。一共有5个模式供用户选择:
1、弹出式:页面只有一个日历牌的图标,用户点击后,弹出控件:
2、普通方式:日历完整显示在网页中:
3、输入框式:页面中显示一个输入框,鼠标点击后弹出日历供用户选择
4、选择框式:页面显示一个标准的选择框和一个日历的图表,点击后弹出日历
5、box:页面显示一个输入框和一个日历图表,点击图标后显示一个日历
该网页的地址http://dry.4thebusiness.com/info/dhtml_calendar
1、在工程文件的根目录下运行下面的更新
ruby script/plugin install http://dhtml-calendar.googlecode.com/svn/trunk
2、在.rhtml文件中置入:
<%= dhtml_calendar_includes %>
这样就可以使用Calendar控件了。一共有5个模式供用户选择:
1、弹出式:页面只有一个日历牌的图标,用户点击后,弹出控件:
<%= popup_calendar 'person', 'birthday',
{ :class => 'date',
:field_title => 'Birthday',
:button_image => 'calendar.gif',
:button_title => 'Show calendar' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true,
:cache => true }
%>
2、普通方式:日历完整显示在网页中:
<%= calendar 'person', 'birthday',
{ :class => 'date' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true }
%>
3、输入框式:页面中显示一个输入框,鼠标点击后弹出日历供用户选择
<%= calendar_field 'person', 'birthday',
{ :class => 'date',
:date => value,
:field_title => 'Birthday',
:button_title => 'Show calendar' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true,
:cache => true }
%>
4、选择框式:页面显示一个标准的选择框和一个日历的图表,点击后弹出日历
<%= calendar_select 'person', 'birthday',
{ :class => 'date',
:date => value,
:field_title => 'Birthday',
:button_title => 'Show calendar' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true,
:cache => true }
%>
5、box:页面显示一个输入框和一个日历图表,点击图标后显示一个日历
<%= calendar_box 'person', 'birthday',
{ :class => 'date',
:date => value,
:field_title => 'Birthday',
:form_name => 'custform',
:button_title => 'Show calendar' },
{ :firstDay => 1,
:range => [1920, 1990],
:step => 1,
:showOthers => true,
:cache => true }
%>
- 16:53
- 浏览 (2236)
- 评论 (1)
- 分类: Ruby on Rails
- 相关推荐
评论
当我用radrails编译工具,使用该控件时,每当我关闭编译工具,然后打开,发现工程服务启动不了,通过检查,发现工程内 /public/images下多一个dhtml_calendar文件夹,它里面包含几张该控件使用到的图片. 究竟是不是它导致工程启动不了呢. 我将文件夹里的图片拷贝.然后,把它删除了,再次启动服务,启动成功.然后,我又关闭编译再打开,发现,dhtml_calendar文件夹又出现了.随后,我将它里面的图片拷贝到/public/images下,再将文件夹删除,再重新打开编译工具,发现dhtml_calendar文件夹就不出现了.问题解决.
发表评论
- 浏览: 101055 次
- 来自: 北京

- 详细资料
搜索本博客
我的相册
IMG_7195
共 46 张
共 46 张
最近加入圈子
最新评论
-
北京太乱了,求你,别来了 ...
深有感触。。。
-- by zisidemao -
【收藏】通过js调用WebSer ...
Where's http://localhost/accountws/servi ...
-- by dayrl -
Xfire在Spring下实现安全 ...
开源否开源社区:http://www.kaiyuanfou.com有更详细的说明
-- by zhongludeng -
Xfire在Spring下实现安全 ...
开源否开源社区:http://www.kaiyuanfouc.com有更详细的说 ...
-- by zhongludeng -
关于EhCache的使用
:o :lol: :cry: :wink:& ...
-- by dsl_0375






评论排行榜