Yii 的 CJuiDatePicker 对我不起作用

发布于 2024-09-18 03:21:32 字数 490 浏览 5 评论 0原文

我复制了 CJuiDatePicker 的 Yii 文档示例: <代码>

$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'name'=>'publishDate',
    // additional javascript options for the date picker plugin
    'options'=>array(
        'showAnim'=>'fold',
    ),
    'htmlOptions'=>array(
        'style'=>'height:20px;'
    ),
));

表单字段已呈现,但当我单击它时没有任何反应,也没有显示日历。 我错过了什么吗?我是否必须手动包含 JQuery,或设置一些 javascript 回调或除上面示例之外的其他内容?

I copied the Yii documentation's example for CJuiDatePicker:

$this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'name'=>'publishDate',
    // additional javascript options for the date picker plugin
    'options'=>array(
        'showAnim'=>'fold',
    ),
    'htmlOptions'=>array(
        'style'=>'height:20px;'
    ),
));

The form field is rendered, but when I click it nothing happens, no calendar is displayed.
Am I missing something? do I have to manually include JQuery, or set some javascript callbacks or anything else than the example above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

↙温凉少女 2024-09-25 03:21:32

当相应的 CSS 文件丢失时,我也遇到了同样的情况。日历确实出现了,尽管远远超出了窗口的边界。

I experienced the same when the corresponding CSS file was missing. The calendar did appear although far beyond the boundaries of the window.

半岛未凉 2024-09-25 03:21:32

抱歉,是我的错。
有一个 .htaccess 拒绝所有,阻止页面从 /assets 目录加载 Jquery 文件。
无论如何,谢谢!

Sorry, my fault.
There was a .htaccess with deny from all, preventing the page from loading the Jquery files from the /assets dir.
Thanks anyway!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文