关于前台查询时,查询条件不同时,garitable域数据展示不同,这里要实现功能要做empty()操作,缓存问题。


            <div class="gridPanel" id="gridPanel">
               <table id="gridTable"></table>
               <div id="gridPager"></div>
</div>

 

function getGrid(){    
            $("#gridPanel").empty();
        $("#gridPanel").append("<table id='gridTable'></table><div id='gridPager'></div>");
            
        var beginTime = $("#beginTime").val();
            var endTime1 = $("#endTime").val();
            var endTime=getLastDay(endTime1);
            var $gridTable=$("#gridTable");
            var url=basePath+"operatingIncome/operatingIncome/operating_income_data.action";
            $gridTable.jqGrid({
                  url:url,
                  postData:{'beginTime':beginTime,'endTime':endTime},
                  datatype:"json",
                  height: ($(document).height() - 300)/2,
                  autowidth:true,
                  colModel:[
                        { label: '时间', name: 'time', index: 'time', width: 150, align: 'center' ,sortable:false},
                        { label: '线路总数', name: 'totalLine', index: 'totalLine', width: 150, align: 'center' ,sortable:false},
                        
                            ],
                  viewrecords:true,
                  rowNum:5,
                  rowList:[5,10,20],
                  pager:"#gridPager",
                  sortname: 'code',
                  sortorder: 'asc',
                  rownumbers:true,
                  shrinkToFit:false,
                  gridview: true,
                  multiselect: true,
                  multiboxonly:true,
                  onSelectRow : function() {
                    },
                  gridComplete : function() {
                    }
                });
        
            }

 

posted @ 2017-04-07 16:43  夜西门吹雪孤城花满楼  阅读(215)  评论(0编辑  收藏  举报