Home > Web Front-end > JS Tutorial > body text

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

一个新手
Release: 2017-09-08 13:44:29
Original
3465 people have browsed it

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();
    }
}
Copy after login

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");
};
Copy after login

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!