var activeTab = $('#tabs ul li[name=<%= this.activeTab %>]');
var activeTabIndex = activeTab.length > 0 ? activeTab.index() : 0;
$("#tabs").tabs({
selected: activeTabIndex,
create: function (e, ui) {
alert('create!');
console.log("create!");
},
activate: function (e, ui) {
alert('here!');
console.log("test");
}
});
The activeTab variable is meant to activate the same tab after POST (it works). The create event is firing as expected. But the activate event is not, and I don't understand why. I'm obviously missing something.
I'm using the following for documentation:
http://api.jqueryui.com/tabs/
Small skeleton of the tabs div.
<div id="tabs">
<ul>
<li name="Admin"><a href="#admin-tab">Admin</a></li>
</ul>
</div>
Determine what version of jQuery UI you are using. Since you are using 1.8, you must use show
instead. See the jQuery UI 1.8 docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With