开发者

Jquery UI Tab not loading on programmatic select with Jquery

开发者 https://www.devze.com 2023-03-14 06:51 出处:网络
Right now I\'ve written a script that after clicking the submit button unhides the next tab and selects it. Here\'s the code:

Right now I've written a script that after clicking the submit button unhides the next tab and selects it. Here's the code:

 var $tabs = $('#tabs').tabs();
        $('#submitbutton').click(function () {
            if ($('#quotesubmit').valid()) {
                var resultDiv = $('#ratesView');
                $.ajax({
                    type: "POST",
                    url: "Rates/Rates",
                    data: {},
                    success: function (response) {
                        resultDiv.html('');
                        resultDiv.html(response);
                    }
                });
                unhidetab();
                $tabs.tabs('select', 2);
                return false;
            }

        });

The script works and the tab is unhidden and then selected. The problem is that the tab isn'开发者_如何学运维t actually loaded. Instead I then have to click on the previous tab and then click back onto the new tab. I've also tried using a $tabs.tabs('load', 2); after the tabs select statement to no avail. Anyone familiar with what might be causing this behavior? Thanks.


try this.. I was having the same issue.

$tabs.tabs('option', 'selected', 2); 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号