Hi, 

I had a jquery datepicker working with my options set like this:

$time_event_end = new ZendX_JQuery_Form_Element_DatePicker(
                    'time_event_end',
                    array('jQueryParams' => array( 'showOn' => "both" ,
'buttonImage' => "/images/jquery/calendar.gif", 'dateFormat' => 'yy-mm-dd',
'buttonImageOnly' => 'true'))
                );              

But i wanted to add a div around the whole element, dt label dd input,
everything.

so i set my custom viewscript like this:

$time_event_end->setDecorators(array(array('ViewScript', array(
                    'viewScript' => '_element.phtml',
                    'id'      => 'time_event_end_div'
                ))));

and then made a element.phtml that looked like this:

<div id="<?= $this->id ?>">
        <dt>
    <?= $this->formLabel($this->element->getName(),
                         $this->element->getLabel()) ?>
     </dt>
     <dd>                        
    <?= $this->{$this->element->helper}(
        $this->element->getName(),
        $this->element->getValue(),
        $this->element->getAttribs()
    ) ?>
    </dd>
    <?= $this->formErrors($this->element->getMessages()) ?>
    <div class="hint"><?= $this->element->getDescription() ?></div>
</div>

now my datepicker dosn't have any options set because the onload function
for it as changed from 


$("#time_event_end").datepicker({"showOn":"both","buttonImage":"\/images\/jquery\/calendar.gif","dateFormat":"yy-mm-dd","buttonImageOnly":"true"});


to 

$("#time_event_end").datepicker({"helper":"datePicker","jQueryParams":{"showOn":"both","buttonImage":"\/images\/jquery\/calendar.gif","dateFormat":"yy-mm-dd","buttonImageOnly":"true"},"options":[]});

What have i done wrong? i don't think its in the .phtm file right? its the
way ive used setDecorators? 

Any and all help gratefully recieved!

Will

-- 
View this message in context: 
http://www.nabble.com/Zendx-Jquery-Datepicker--custom-viewscript-tp20713703p20713703.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to