zoukankan      html  css  js  c++  java
  • jqGrid 学习笔记--数据异步加载方法(转)

    var commonQuery = '../importantInfoReport/pageQueryImportantInfoReport.action?type=0'; 
        jQuery("#listImportInfoReport").jqGrid ({ 
            rowNum : 10, 
            type:'POST', 
            pager : '#pagerImportantInfoReport', 
            viewrecords : true, 
            multiselect: true, 
             defaultGridWidth, 
            height : defaultGridHeight, 
            url: commonQuery, 
            datatype : "json", 
            jsonReader: {  
              root:"dataRows", page:"page", total:"total", records:"records", repeatitems:false, id : "id" 
            }, 
            colNames : [ 
                'ID', 
                '事件名称', 
                '事件等级', 
                '进展情况', 
                '接收范围', 
                '报送人', 
                '报送时间', 
                '操作' 
            ], 
            colModel : [ 
                {name:'id', label:'ID', index:'id',hidden:true} 
                , {name:'eventName', label:'事件名称', index:'eventName', 100} 
                , {name:'state', label:'事件等级', index:'state',hidden:true} 
                , {name:'progress', label:'进展情况', index:'progress', 100} 
                , {name:'receiver', label:'接收范围', index:'receiver', 150} 
                , {name:'sendor', label:'报送人', index:'sendor',hidden:true} 
                , {name:'createTime', label:'报送时间', index:'createTime',formatter:'date',formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'}, 70} 
                , {name:'action', index:'action',align:"center", 60} 
            ], 
            sortname: 'id', 
            sortorder:  'desc', 
            gridComplete : function() { 
                var ids=jQuery("#listImportInfoReport").jqGrid('getDataIDs'); 
                for(var i=0;i<ids.length;i++) 
                { 
                    var cl = ids[i]; 
                    //alert(cl); 
                    var rowdata=jQuery("#listImportInfoReport").jqGrid('getRowData',cl); 
                    //实例ID 
                    var Id=rowdata["id"];                
                    be = "<input style='height:22px;40px;' type='button' value='查看' onclick='javascript:viewImportantInfoReportById(" + Id +")'/>";  
                    del = "<input style='height:22px;40px;' type='button' value='删除' onclick='javascript:delImportantInfoReportById(" + Id +")'/>";      
                    jQuery("#listImportInfoReport").jqGrid('setRowData',ids[i],{action:be+del}); 
                } 
            }, 
            onSelectRow: function(id){ 
                 
            } 
        }); 
        jQuery("#listImportInfoReport").jqGrid('navGrid', "#pagerImportantInfoReport", { 
            edit : false, add : false, del : false, multipleSearch : false, search : false 
        }); 
  • 相关阅读:
    android-为应用单元测试
    android手机拨号器实现
    android模拟器使用
    android开发环境搭建
    C语言之关键字
    linux shell脚本基础-----3
    linux shell脚本基础-----2
    linux shell脚本基础-----1
    Android学习计划
    MySql 绿色版配置
  • 原文地址:https://www.cnblogs.com/hebo/p/5008471.html
Copyright © 2011-2022 走看看