Hello everybody, in the view stated thus:
<div class="row">
<?php echo $form->labelEx($newsPublication,'publicationdate'); ?>
<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker',array(
'model'=>$newsPublication,
'attribute'=>'publicationdate',
'mode'=>'date'
));
?>
<?php //echo $form->textField($newsPublication,'publicationdate'); ?>
<?php echo $form->error($newsPublication,'publicationdate'); ?>
</div>
And I copied the folder protected/extensions/CJuiDateTimePicker
But the following error in firebug:
What’s missing?
Another thing, when I use an extension, what do I have to config/main.php?
Thanks!
softark
(Softark)
June 17, 2011, 8:56am
2
It seems that the jquery-ui(.min).js is missing.
Yii::app()->getClientScript()->registerCoreScript('jquery-ui', CClientScript::POS_HEAD);
might work.
softark:
It seems that the jquery-ui(.min).js is missing.
Yii::app()->getClientScript()->registerCoreScript('jquery-ui', CClientScript::POS_HEAD);
might work.
The error continue…
_form.php
<?php Yii::app()->getClientScript()->registerCoreScript('jquery-ui', CClientScript::POS_HEAD); ?>
...
<div class="row">
<?php echo $form->labelEx($newsPublication,'publicationdate'); ?>
<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
$this->widget('CJuiDateTimePicker',array(
'model' => $newsPublication,
'attribute' => 'publicationdate',
'mode' => 'datetime',
));
?>
<?php //echo $form->textField($newsPublication,'publicationdate'); ?>
<?php echo $form->error($newsPublication,'publicationdate'); ?>
</div>
...
softark
(Softark)
June 17, 2011, 3:02pm
4
Does the line report an error? If it does, what kind?
I’m sorry, I’m not familiar with firebug … I’m using chrome’s developer tool.
I demonstrated that the file jquery-ui(.min.).js loaded
softark
(Softark)
June 17, 2011, 5:15pm
6
I see.
I’m sorry, but I’m lost too.
Have you got other information that can be relevant to the problem?
Worse than not, I am new in Yii.
In short I want to put a calendar in a date field, needed only a simple example which has a field with a calendar using Yii
jkofsky
(Jkofsky)
June 17, 2011, 5:34pm
8
I posted a example on this previously.
softark
(Softark)
June 17, 2011, 11:41pm
10
I’ve noticed that you are using a lot of jquery-ui stuffs together with Datepicker, namely elFinder, tinyMCE, …
And googling "elFinder Datepicker" has brought me to a page like this: http://elrte.org/redmine/boards/2/topics/775
The article is a little old now, but may bring some light on the problem.
So, why don’t you start just with a Datepicker (or DateTimePicker) without those stuffs? If it works, then add them one by one to check the possible conflicts among them.
softark:
I’ve noticed that you are using a lot of jquery-ui stuffs together with Datepicker, namely elFinder, tinyMCE, …
And googling "elFinder Datepicker" has brought me to a page like this: http://elrte.org/redmine/boards/2/topics/775
The article is a little old now, but may bring some light on the problem.
So, why don’t you start just with a Datepicker (or DateTimePicker) without those stuffs? If it works, then add them one by one to check the possible conflicts among them.
Thanks for the tip, actually remove the tinyMCE, the calendar is working:
<div class="row">
<?php //echo $form->labelEx($model,'body'); ?>
<?php //$this->widget('application.extensions.tinymce.ETinyMce', array('editorTemplate'=>'full', 'model'=>$model, 'attribute'=>'body')); ?>
<?php //echo $form->error($model,'body'); ?>
</div>
But how to solve this?
nguyendh
(Duynguyen0511)
June 20, 2011, 10:29pm
12
Please use Zii CJuiDatePicker which is a wrapper of Jquery UI Datepick.
Tutorial @ http://www.yiiplayground.cubedwater.com/index.php?r=UiModule/jui/ziiDatePicker
If you have question, I am here to help. I’ve done enough with ziiDatePicker to know 1 or 2 tricks
Thank’s nguyendh, but continued to be conflicts with TinyMCE:
softark
(Softark)
June 21, 2011, 4:12pm
14
I don’t use javascript WYSIWYG editors myself, so I can’t help you much on this.
But there are a few thins that I can think of.
TinyMCE extension that you are using seems a little bit out of date. It wraps TinyMCE 3.2.5 but the current version of TinyMCE is 3.4.3.1. I’m afraid that this is the cause of the conflict against DateTimePicker (or the underlying latest jquery-ui). I’m not really sure of, though.
The author of the extension says that an update will be coming soon. tinymce extension
Another candidate for a tinymce extension may be "tinymceelfinder". http://www.yiiframework.com/extension/tinymceelfinder
This wraps TinyMCE 3.3.8.
I think it’s worth trying.
[EDIT]
As for CJuiDateTimePicker and CJuiDatePicker, the former is a very thin wrapper over the latter when it operates on "date" mode as far as I can see. There should be no substantial difference between the two in your case.
nguyendh
(Duynguyen0511)
June 21, 2011, 5:15pm
15
try this http://forum.jquery.com/topic/jquery-ui-input-zindex-is-not-a-function
also, google [b(a).zIndex is not a function], I’ve seen some posts talking about your problem.