Jquery UI 选项卡未在使用 Jquery 进行编程选择时加载
现在我已经编写了一个脚本,单击提交按钮后会取消隐藏下一个选项卡并选择它。代码如下:
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;
}
});
脚本有效,选项卡取消隐藏,然后被选中。问题是该选项卡实际上并未加载。相反,我必须单击上一个选项卡,然后单击返回新选项卡。我也尝试过使用 $tabs.tabs('load', 2);选项卡选择语句之后无济于事。任何人都熟悉可能导致此行为的原因吗?谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个..我也遇到了同样的问题。
try this.. I was having the same issue.