English 中文(简体)
JQGRID + Timer + setgroupHeaders = 多个头脑组群
原标题:JQGRID + Timer + setGroupHeaders = multiple header grouping rows

我只想看几个要点。 I m 建造一个超文本页面,有60秒(javascript),用我的服务器的最新数据更新jqGrid(v4.2.0)。 我有工作报酬,希望加上新的组群主选择,把田地集中起来。 我把该守则放在网格中,以添加头盔组,但每60秒将一米带重复头盔。 我不禁要问,在电网重新填满后,在谁能起重机组的作用?

谢谢!

$(document).ready(function () {
    ckTimer = setTimeout("sendTimer();", 1000);
});

function sendTimer() {
    var d = new Date();
    document.getElementById( currentDay1 ).innerHTML = d.toDateString() + "       " + d.toLocaleTimeString();
    document.getElementById( currentDay2 ).innerHTML = d.toDateString() + "       " + d.toLocaleTimeString();
    var sec = d.getSeconds();
    ckTimer = setTimeout("sendTimer();", (60 - sec) * 1000);
    jQuery("#Report2").jqGrid().trigger( reloadGrid );
    if (rptframe)
        if (rptframe.reload)
            rptframe.reload();
}

    $(function () {
        jQuery("#Report2").jqGrid({
            url:  DashboardHandler.ashx?act=DetailReport ,
            datatype:  json ,
            height: 250,
            width: 1200,
            colNames: [ Interval ,  Volume (Offered) ,  Service Level ,  Average Speed To Answer ,  Abandon Rate ,  Average Handle Time ,    ,  Volume (Offered) ,  Service Level ,  Average Speed To Answer ,  Abandon Rate ,  Average Handle Time ,   ,   ],
            colModel: [
                { name:  Interval , index:  Interval , width: 125, sortable: false, align: "left" },
                { name:  TSGVolume , index:  TSGVolume , width: 100, sortable: false, align: "center" },
                { name:  TSGCalcSLA , index:  TSGCalcSLA , width: 100, sortable: false, align: "center" },
                { name:  TSGASA , index:  TSGASA , width: 100, sortable: false, align: "center" },
                { name:  TSGAbnd , index:  TSGAbnd , width: 100, sortable: false, align: "center" },
                { name:  TSGAHT , index:  TSGAHT , width: 100, sortable: false, align: "center" },
                { name:  space , index:  space , width: 50, sortable: false, align: "center" },
                { name:  SCVolume , index:  SCVolume , width: 100, sortable: false, align: "center" },
                { name:  SCCalcSLA , index:  SCCalcSLA , width: 100, sortable: false, align: "center" },
                { name:  SCASA , index:  SCASA , width: 100, sortable: false, align: "center" },
                { name:  SCAbnd , index:  SCAbnd , width: 100, sortable: false, align: "center" },
                { name:  SCAHT , index:  SCAHT , width: 100, sortable: false, align: "center" },
                { name:  TSGASA_H , index:  TSGASA_H , width: 0, sortable: false, align: "center", hidden: true },
                { name:  SCASA_H , index:  SCASA_H , width: 0, sortable: false, align: "center", hidden: true }
            ],
            rowNum: 100,
            rowList: [100, 250, 500],
            pager:  #Report2Pager ,
            viewrecords: true,
            gridComplete: setClr
        })
        jQuery("#Report2").jqGrid( navGrid ,  #Report2Pager , { edit: false, add: false, del: false });
    });
    jQuery("#Report2").jqGrid( setGroupHeaders , {
        useColSpanStyle: false,
        groupHeaders: [
                { startColumnName:  TSGVolume , numberOfColumns: 5, titleText:  TSG  },
                { startColumnName:  SCVolume , numberOfColumns: 5, titleText:  Solution Center  }
            ]
    });

function setClr() {
        var i, val;
        for (i = 1; i <= 27; i++) {
            val = $( #Report2 ).jqGrid( getRowData , i);
            if (val["TSGCalcSLA"] < 70)
                $( #Report2 ).jqGrid( setCell , i, "TSGCalcSLA",   ,  red-highlight );
            else if (val["TSGCalcSLA"] > 80)
                $( #Report2 ).jqGrid( setCell , i, "TSGCalcSLA",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "TSGCalcSLA",   ,  yellow-highlight );

            if (val["SCCalcSLA"] < 70)
                $( #Report2 ).jqGrid( setCell , i, "SCCalcSLA",   ,  red-highlight );
            else if (val["SCCalcSLA"] > 80)
                $( #Report2 ).jqGrid( setCell , i, "SCCalcSLA",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "SCCalcSLA",   ,  yellow-highlight );

            if (val["TSGASA_H"] > 60)
                $( #Report2 ).jqGrid( setCell , i, "TSGASA",   ,  red-highlight );
            else if (val["TSGASA_H"] <= 30)
                $( #Report2 ).jqGrid( setCell , i, "TSGASA",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "TSGASA",   ,  yellow-highlight );

            if (val["SCASA_H"] > 60)
                $( #Report2 ).jqGrid( setCell , i, "SCASA",   ,  red-highlight );
            else if (val["SCASA_H"] <= 30)
                $( #Report2 ).jqGrid( setCell , i, "SCASA",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "SCASA",   ,  yellow-highlight );

            if (val["TSGAbnd"] > 4.6)
                $( #Report2 ).jqGrid( setCell , i, "TSGAbnd",   ,  red-highlight );
            else if (val["TSGAbnd"] <= 4.4)
                $( #Report2 ).jqGrid( setCell , i, "TSGAbnd",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "TSGAbnd",   ,  yellow-highlight );

            if (val["SCAbnd"] > 4.6)
                $( #Report2 ).jqGrid( setCell , i, "SCAbnd",   ,  red-highlight );
            else if (val["SCAbnd"] <= 4.4)
                $( #Report2 ).jqGrid( setCell , i, "SCAbnd",   ,  green-highlight );
            else
                $( #Report2 ).jqGrid( setCell , i, "SCAbnd",   ,  yellow-highlight );
        }
            jQuery("#Report2").jqGrid( setGroupHeaders , {
                useColSpanStyle: false,
                groupHeaders: [
                { startColumnName:  TSGVolume , numberOfColumns: 5, titleText:  TSG  },
                { startColumnName:  SCVolume , numberOfColumns: 5, titleText:  Solution Center  }
            ]
            });
    };
    function reload() {
        jQuery("#Report2").jqGrid().trigger( reloadGrid );
    }
问题回答

我也有多个头脑,因为我使用的文字标签setGroupHeaders 位于div以显示我的jQgrid。

而这一条是<代码>jqueryui Dialog的四处。

因此,每当我通过一个纽芬兰语开放我的方言时,就添加了一个新的<代码>集团Header。

解决这一问题, 我已将文字标签移到方言 d中。

I hope it will help someone else.

Solution :

<div id="dialog_div">
    <table id="my_grid"></table>
    <div id="grid_pager"></div>
</div>

<script>
  // Initialize the grid here
</script>




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...