Skip to content

Commit 24fe25f

Browse files
committed
新增刷新iframe中的表格功能
1 parent 3d268c7 commit 24fe25f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

jquery.addtabs.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
tab: '.tab-addtabs',
1717
iframeUse: true, //使用iframe还是ajax
1818
iframeHeight: $(window).height() - 50, //固定TAB中IFRAME高度,根据需要自己修改
19-
iframeForceRefresh: false, //点击后强制刷新对应的iframe
19+
iframeForceRefresh: false, //点击后强制加载对应的iframe
20+
iframeForceRefreshTable: false, //点击后强制刷新对应的iframe中的table
2021
callback: function () {
2122
//关闭后回调函数
2223
}
@@ -141,6 +142,15 @@
141142
$("#" + conid + " iframe").attr('src', function (i, val) {
142143
return val;
143144
});
145+
} else if (options.iframeForceRefreshTable) {
146+
try {
147+
//检测iframe中是否存在刷新按钮
148+
if ($("#" + conid + " iframe").contents().find(".btn-refresh").size() > 0) {
149+
$("#" + conid + " iframe")[0].contentWindow.$(".btn-refresh").trigger("click");
150+
}
151+
} catch (e) {
152+
153+
}
144154
}
145155
}
146156
localStorage.setItem("addtabs", $(this).prop('outerHTML'));

0 commit comments

Comments
 (0)