Home >Web Front-end >JS Tutorial >How to use easyui to refresh the data of the specified tab page

How to use easyui to refresh the data of the specified tab page

一个新手
一个新手Original
2017-09-08 13:44:293511browse

Use tab management in Home/Index and set a refresh method in the home page.

/**
 * 刷新指定的tab里面的数据
 * @param title 选项卡标题
 * @param refreshTabFunc  自定义的刷新方法(再各个页面具体实现)
 */
function refreshTabData(title,refreshGridFunc)
{
    if ($("#tabs" ).tabs('exists', title)) {
        $('#tabs').tabs('select' , title);
        typeof refreshGridFunc === 'function' && refreshGridFunc.call();
    }
}

Customize your own refresh method for the page to be refreshed, refresh the data, etc.

I define it in the task interface Task/Index.js:

window.top["reload_taskTab"] = function () {
    datagrid.reload("#task_tab");
};

The method is stored in the window.top attribute, and the name of the method is reload_taskTab. The specific implementation code is written in it.

I updated the task information in Task/Edit.js, then I have to refresh the datagrid table data in the task list tab page.

Then after editing is completed, just write:

window.parent.refreshTabData("任务列表",window.top.reload_taskTab);

The above is the detailed content of How to use easyui to refresh the data of the specified tab page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn