adding jquery.datepick to bloack add/edit

Permalink
tossed jquery.datepick.js into the /js folder.

is that auto added to the header? or do I need to use some sort of "addheader" code to the add.php of the block?

any help would be GREATLY appreciated.

RadiantWeb
 
jbx replied on at Permalink Reply
jbx
You may find that it's already available. I use the datepicker on a form in my dashboard and just added
$(function() {
   $("#datepicker").datepicker({ dateFormat: 'dd-mm-yy' });
});
to my page.

If that doesn't work, then to add to the header, you can use the following in your blocks controller:
public function on_page_view() {
    $html = Loader::helper('html');
    $this->addHeaderItem($html->javascript('jquery.datepick.js'));
    $this->addHeaderItem($html->css('datepick.css'));
}


HTH

Jon