|
Pedro, you adressed another problem, but i think you don't echo the jQuery Object in your header. Look at this example: <?= $this->jQuery()
->addStylesheet('/script/jquery/themes/smoothness/jquery-ui-1.7.1.custom.css')
->setUiLocalPath('/script/jquery/jquery-ui-1.7.1.custom.min.js')
->setLocalPath('/script/jquery/jquery-1.3.2.min.js'); ?>
If you do, check your render mode. It's better to not set it in your case, so the object writes all necessary data to the document. Thorsten It would be especially nice if there was a way to set the protected $_elementHtmlTemplate variable. Or as mentioned above, have the correct HTML. The example that the original poster displayed is incorrect HTML (note the use of unordered lists with no list item tags after). <ul>
<h3><a>Title</a></h3>
<div>CONTENT</div>
<h3><a>Title</a></h3>
<div>CONTENT</div>
</ul>
The example provided in the documentation (and example.html files) is below: <div id="accordion">
<div>
<h3><a href="#">First</a></h3>
<div>First Content</div>
</div>
<div>
<h3><a href="#">Second</a></h3>
<div>Second Content</div>
</div>
</div>
Sorry for invalid xhtml. Here are the correction: <div> <h3><a>Title</a></h3> <div>CONTENT</div> <h3><a>Title</a></h3> <div>CONTENT</div> </div> I find it not usefull to change the used html template for the accordion element. Instead it should simple create correct markup. If you need an element with changed markup, extend the element and overwrite $_elementHtmlTemplate. For this reason benjamin used protected and not private declaration for this variable. Thorsten Ruf In my current practice I have simply extended the element. However, upon seeing this bug report, I felt the current examples that jQuery UI uses (like the example you provided), would be more appropriate than the current template that is set for this, and other UI components. after changing the $_elementHtmlTemplate variable in the helper it started to work thnx
I'll look into it, but i have to check if your proposed accordion structures work with UI 1.5 as well, so that the helper works on both. Changed priority to minor, because overriding is possible Hi Benjamin, i'm sorry, but i really can't understand the priority change. If you leave the code as it is at the moment, a beginner have to extend the Element and overwrite the template variable. I appreciate your work a lot, but if you take a look at the documentation only one or two elements are working "out of the box" with the actual version of jQuery. I spent a lot of time to fix some elements, because i need the latest versions. At the moment you can download UI as follwoing: Setting priority to critical. As the functionality clearly does not work (AT ALL!), and the functionality is therebye rendered useless. Hi, @pedro: i run in the same issue, i just added the Jquery accordion call myself with </script> so i ended up with calling addJavascript() with an empty string. Fixed in trunk and merged back into 1.8 release branch. The use of $view->jQuery()->setUiVersion(...) It still doesn't work in ZF 1.8.4 which i downloaded today! BOOTSTRAP: $view = Zend_Layout::getMvcInstance()->getView();
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
ZendX_JQuery::enableView($view);
$view->jQuery()
->setUiVersion ('1.7.2')
->addStylesheet ('/styles/custom-theme/jquery-ui-1.7.2.custom.css')
->setLocalPath ('/scripts/jquery-1.3.2.min.js')
->setUiLocalPath('/scripts/jquery-ui-1.7.2.min.js');
CONTROLLER: $a = new ZendX_JQuery_View_Helper_AccordionContainer();
$a->setView($this->view);
$a->addPane("a", "a1", "blabla", array());
$a->addPane("a", "a2", "blabla", array());
$a->addPane("a", "a3", "blabla", array());
$this->view->assign("tabs", $a->accordionContainer("a", array(), array()));
OUTPUT: <div id="a"> <a href="#">a1</a><div>blabla</div> <a href="#">a2</a><div>blabla</div> <a href="#">a3</a><div>blabla</div> </div> <h3> around the <a></a> ist still missing, should be: <div id="a"> <h3><a href="#">a1</a></h3><div>blabla</div> <h3><a href="#">a2</a></h3><div>blabla</div> <h3><a href="#">a3</a></h3><div>blabla</div> </div> You have to change Line 146 in AccordionContainer.php (/extras/library/ZendX/JQuery/View/Helper) from $this->_elementHtmlTemplate = '<a href="#">%s</a><div>%s</div>'; to $this->_elementHtmlTemplate = '<h3><a href="#">%s</a></h3><div>%s</div>'; |
||||||||||||||||||||||||||||||||||||||
hello i have the same problem and the
Sample Input
<div id="barra-lateral1"> <?= $this->accordionContainer() ->addPane("accord1", "Accord 1", "sample text 1") ->addPane("accord1", "Accord 2", "sample text 2") ->addPane("accord1", "Accord 3", "sample text 3") ->accordionContainer("accord1", array(), array("class" => "lightness")); ?> </div>Sample Output
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link rel="stylesheet" href="/ZendCMS/admin/js/css/ui-lightness/jquery-ui-1.7.1.custom.css" type="text/css" media="screen" /> <script type="text/javascript" src="/ZendCMS/admin/js/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/ZendCMS/admin/js/js/jquery-ui-1.7.1.custom.min.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { $("#Login").dialog({"title":"Log in"}); }); //]]> </script></head> <body> <div id="cabecalho"> </div> <div id="barra-lateral1"> <ul class="lightness" id="accord1"> <li class="ui-accordion-group"><a href="#" class="ui-accordion-header">Accord 1</a><div class="ui-accordion-content">sample text 1</div></li> <li class="ui-accordion-group"><a href="#" class="ui-accordion-header">Accord 2</a><div class="ui-accordion-content">sample text 2</div></li> <li class="ui-accordion-group"><a href="#" class="ui-accordion-header">Accord 3</a><div class="ui-accordion-content">sample text 3</div></li> </ul> </div> ...it's missing the
$("#accord1").accordion({});
on the $(document).ready(function()