easyui刷新指定tab页里面的表数据

easyui刷新指定tab页里面的数据

主页Home/Index中使用tab管理,在主页中设置一个刷新的方法。
/**
 * 刷新指定的tab里面的数据
 * @param title 选项卡标题
 * @param refreshTabFunc  自定义的刷新方法(再各个页面具体实现)
 */
function refreshTabData(title,refreshGridFunc)
{
    if ($("#tabs" ).tabs('exists', title)) {
        $('#tabs').tabs('select' , title);
        typeof refreshGridFunc === 'function' && refreshGridFunc.call();
    }
}
再要被刷新的页面自定义自己的刷新方法,刷新那些数据等.

我在列表界面list.jsp中定义:

window.top["reload_formList"] = function () {
    $("#formList").datagrid("reload");
};
方法存储在window.top属性里面去,方法的名字叫 reload_formList实现具体代码写在里面。

我在Edit.jsp里面更新了信息,那么就得刷新列表tab页里面的datagrid表格数据。

那么编辑完成后就直接写:

window.parent.refreshTabData("检验单",window.top. reload_formList);

猜你喜欢

转载自ljg-java.iteye.com/blog/2410847