I don't know if this is any help, but I got the mootools calendar from
[http://www.electricprism.com/aeron/calendar/] running very easily.

(Using mootools1.2.1; need calendar.compat.js from the above link)

This is all the code that is necessary for unobtrusive integration:

(I agree that the `obj` construction is odd... the parameters are done
in a wierd way)

[code also posted here: http://bin.cakephp.org/view/980647196 for
clarity]

<?php
// Demo form for testing
echo $form->create('Article');
echo $form->inputs();
echo $form->end('Submit');

// Add css and js
$javascript->link('calendar.compat', false);
$html->css('calendar', null, array(), false);

// Add code to transform all datetime and date fields
echo $javascript->codeBlock(trim("
window.addEvent('domready', function() {
        $$('form .datetime', 'form .date').each(function(div) {
                var last = null;
                var y = div.getElement('select[name*=year]');  if (!last ||
y.offsetLeft > last.offsetLeft) last=y;
                var m = div.getElement('select[name*=month]'); if (!last ||
m.offsetLeft > last.offsetLeft) last=m;
                var d = div.getElement('select[name*=day]');   if (!last ||
d.offsetLeft > last.offsetLeft) last=d;
                if (y && m && d) {
                        var obj = {}; obj[last.id] = {}; 
obj[last.id][y.id]='Y'; obj
[last.id][m.id]='m'; obj[last.id][d.id]='d';
                        new Calendar(obj);
                }
        });
});
"));

?>

hth
grigri

On Dec 10, 11:06 am, Pillow <[EMAIL PROTECTED]> wrote:
> OK.. Update - Problem resolved!
> It was my bad, I had put plurals
> var $uses = array('Orders', 'Businesses');
> in the controller instead of singular!
>
> Thanks very much for your help, sorry it was a waste of your time!
>
> I would however like to get the 'unobtrusive date picker' to work - if
> anyone has any advice as to how the instructions in the article above
> can be adapted for 1.2 that would be a real bonus.
>
> Kindest Regards
> Ed

On Dec 10, 11:06 am, Pillow <[EMAIL PROTECTED]> wrote:
> OK.. Update - Problem resolved!
> It was my bad, I had put plurals
> var $uses = array('Orders', 'Businesses');
> in the controller instead of singular!
>
> Thanks very much for your help, sorry it was a waste of your time!
>
> I would however like to get the 'unobtrusive date picker' to work - if
> anyone has any advice as to how the instructions in the article above
> can be adapted for 1.2 that would be a real bonus.
>
> Kindest Regards
> Ed
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to