Use Ajax with jQuery UI in Zend
Hello stakers I wonder if it is possible to use ajax link with jQuery ui tools in Zend Framework :
I have a tabContainer, but all tabs content has to be given at creation time.. is there any simple way to use ajax for load only content in the selected pane ?[EDIT]
I finally found it :$this->tabPane(
'MyTabGroup',
'', // no content needed cause we're loading it with Ajax
array(
'title' => 'My link title',
// here is the trick : contentUrl contains the url we want to load with Ajax
'conte开发者_如何学运维ntUrl' => $this->url(array(
'module' => 'default',
'controller' => 'declaration',
'action' => 'consulter'
)
),
)
);
You want your UI Tabs plugin to load a URL instead of toggling the visibility of existing content?
If that's the case then you can check out the UI Tabs demo page for examples: http://jqueryui.com/demos/tabs/
$('#example').tabs({
load: function(event, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});
}
});
UI Tab will now load the <a>
href into the tab space using AJAX.
精彩评论