Problem using js jquery helper

Posted by Josh R on Stack Overflow See other posts from Stack Overflow or by Josh R
Published on 2011-01-07T14:52:22Z Indexed on 2011/01/07 14:53 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

hi,

I am using cakephp 1.3.6 and am trying to use inbuilt js helper. I have added

var $helpers = array('Js' => array('Jquery'));

in my controller. In my layout, I have included the jquery files and have also included

echo $this->Js->writeBuffer(); 

before the </body> tag.

I checked if the jquery libraries correctly but trying to create a simple accordian from the jqueryui.com, it works fine.

But when I try

<?php
    $this->Js->get('#element');
    $this->Js->drag(array(
        'container' => '#content',
        'start' => 'onStart',
        'drag' => 'onDrag',
        'stop' => 'onStop',
        'snapGrid' => array(10, 10),
        'wrapCallbacks' => false
    ));
?>
<div="element">something</div>

It does not work.

I appreciate any help.

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about cakephp