zoukankan      html  css  js  c++  java
  • 处理Easyui的Datagrid无法及时刷新问题

    在Easyui中打打开窗口dialog控件,当做完修改操作之后,关闭dialog控件刷新Datagrid,有时候无法及时刷新。

    1、JavaScript中的代码

    [javascript] view plaincopy
     
    1. function doEdit(){                  
    2.         var timeText=$('#type2').combobox('getText');  
    3.         var timeValue=$('#type2').combobox('getValue');  
    4.         if(timeText==timeValue){  
    5.             timeText="";  
    6.             timeValue="";  
    7.         }  
    8.         $.messager.defaults={ok:"确定",cancel:"取消"};   
    9.         $.messager.confirm('Confirm', '您确定修改?', function(r){  
    10.             if (r){  
    11.                 $.ajax({  
    12.                        type: "POST",  
    13.                        url: "load!editDowntable.action",  
    14.                        data:"edit_id="+ $('#id2').val()+"&edit_title="+$('#title2').val()+"&edit_persontype="+timeValue+"&edit_cpersontype="+timeText+"&edit_loadtime="+$('#time2').datetimebox('getValue')  
    15.                                      
    16.                 });  
    17.                   }          
    18.             $('#editDlg').dialog('close');  
    19.             $('#tt').datagrid({  
    20.                 url:"load!queryTable.action"  
    21.   
    22.             });  
    23.               
    24.         });  
    25.           
    26.           
    27.     }<pre name="code" class="javascript"></pre><br>  


    2、html中的代码

    [html] view plaincopy
     
      1.    <table id="tt">          
      2.      <thead>  
      3.         <th data-options="field:'title',title:'标题',140"></th>  
      4.         <th data-options="field:'cpersontype',title:'类型',120"></th>  
      5.         <th data-options="field:'loadtime',title:'创建时间',120,formatter:formattime"></th>  
      6.     </thead>      
  • 相关阅读:
    使用子查询可提升 COUNT DISTINCT 速度 50 倍
    页面装载js及性能分析方法
    用CSS创建打印页面
    每个Web开发者都应该知道的关于URL编码的知识
    C IO programming test code
    全球NTP服务器列表
    MySQL数据的查询注意
    Python使用pyMysql模块插入数据到mysql的乱码解决
    单元测试
    python threading.thread
  • 原文地址:https://www.cnblogs.com/henuyuxiang/p/4283017.html
Copyright © 2011-2022 走看看