Zend Framework Jquery Sortable

I have been trying to get JQuery Sortable working on my Zend Framework application but only with limited succes. I have been using the ZendX library for most of the Jquery functionality that i need such as the datepicker and those work perfectly fine. I just can't seem to be able to get sortable to wich is not supported in the ZendX library. As for the code. In my bootstrap i have defined the helper path for Jquery etc. as per useual: protected function _initViewHelpers() { $view = new Zend_View(); $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); $view->jQuery()->setLocalPath('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js') ->setUiLocalPath('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js') ->addStylesheet('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css'); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); } I then activate JQuery in the layout using `echo $this->jQuery()->enable();` Now this works all fine, the datepicker works and it shows the Smoothness design as intended etc. Now i implement a small list with a the simple sortable script as follows in my index.phtml:
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
The only way i can get this to work is to add the line to the index.phtml. This to me looks just about as ridiculous as it gets. in the bootstrap i already add this script so why should i have to do this again just to get sortable to work? Anyone happen to have a solution to my problem? Any advice will be appreciated :)
Could you please vote to my answer as this is perfectly satisfied your requirments

以上就是Zend Framework Jquery Sortable的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏