jqGrid - Firefox和IE的奇怪行为

时间:2013-05-17 20:15:01

标签: jquery internet-explorer firefox jqgrid

我有一个jqGrid,它以两种方式之一填充 - 一个提交按钮将在一个表上创建一行,然后在刷新jqGrid时加载,并且还通过在网格上选择一行,这将导致提交&取消按钮显示,允许用户重新提交先前提交的项目。

所需的行为(在jqGrid上)是(1)用于刷新jqGrid时显示的消息,因为项目被提交到表格,以及(2)当jqGrid中的选定消息被重新提交时用户选择&重新提交。除非选择了行,否则不会显示重新提交/取消按钮,此时页面上其他位置的控件将被锁定,并且在用户提交或取消选择之前无法选择。重新提交时,再次添加该项目,并刷新网格,并清除任何选择。重新提交/取消按钮被隐藏。在取消时,它不会刷新网格,但会清除所做的选择,并隐藏重新提交/取消按钮。

在Firefox中,当选择之前提交的项目之一时(例如,存在4行并且点击第2行),突出显示第1行&如果提交,则重新提交第1行(而不是第2行)。选择行的顺序似乎并不重要,但是行1和1是行。 3是唯一在单击时突出显示为选中的人。

在IE中,有几件事是个问题。首先,不显示页脚行。其次,单击任何行不会显示按钮或显示以任何方式选择行。

以下是jqGrid的代码。

    $("#myGrid").jqGrid({
        url: changedUrl,
        datatype: "xml",
        colNames: ["Destination", "Message Text", "Send Time"],
               colModel:[
            {name:"Destination",index:"Destination",width:col1width,align:"left", xmlmap:"Rowset>Row>Destination",sortable:false},
            {name:"MessageText",index:"MessageText",width:col2width,align:"left",xmlmap:"Rowset>Row>MessageText",sortable:false},
            {name:"SendTime",index:"SendTime",width:col3width,align:"left",xmlmap:"Rowset>Row>SendTime",sortable:false}
            ],
        viewrecords: true,
        caption: capMsg,
//      rowNum: nbrRows,
        rownum: 0,
        autowidth: false,
        //height: gridheight,
        height: "100%",
        width: gridwidth,
        //rowList:[10,20,30],
        toolbar: [true, "top"],
        pager: jQuery("#pager1"),
        sortname: "SendTime",
        defaults: {
            recordtext: "View {0} - {1} of {2}",
            emptyrecords:  "No records to view",
            pgtext: "Page  {0} of {1}"
            },

        // code to view the row follows
        onSelectRow:  function(id) {
        //  $(this).jqGrid("viewGridRow", id, {closeOnEscape:true});
            var gridRow = $(this).jqGrid("getRowData",id);
            $(".sendAgainControls").show();
            $("#dList").prop("disabled", true);
            $("#cmlist").prop("disabled", true);
            $("#SendMsg").prop("disabled", true);

            $("#ReSend").click(function() {
                //console.log("ReSend Button was pressed.  Dest = " + gridRow.Destination + "  CM = " + gridRow.MessageText);
                ReSendMessage(gridRow.Destination, gridRow.MessageText);
                $(".sendAgainControls").hide();
                $("#dList").prop("disabled", false);
                $("#cmlist").prop("disabled", false);
                //$(this).jqGrid("resetSelection");

                });

            $("#Cancel").click(function() {
                $(".sendAgainControls").hide();
                $("#dList").prop("disabled", false);
                $("#cmlist").prop("disabled", false);
                $("#myGrid").jqGrid("setSelection", "-1");
                ReloadGrid();
                });
            },

        xmlReader:  { 
            root: "Rowsets", 
                    row: "Row",
            repeatitems: false,
            id: "Destination"
            }
        });

由于我在每个浏览器中遇到多个问题,我不知道从哪里开始。

网格的HTML如下:

<table id="myGrid" border="0" cellpadding="0" cellspacing="0"  style="width: 80%">
<div id="pager1"></div>
</table>
<table id="ReSend" border="0" cellpadding="0" cellspacing="0"  style="width: 80%">
<tr>
<td class="sendAgainControls"  align="center">
<div id="sendAgain">
<input id="ReSend" type="submit" value="Re-Send Selected"  />
<input id="Cancel" type="submit" value="Cancel Re-Send"  />
</div>
</td>
</tr>
</table>

我很感激每个浏览器发生的事情。

谢谢,

取值

1 个答案:

答案 0 :(得分:0)

这一定是内存问题。如上所述在3天前执行,但是当系统重新启动时,所有问题都消失了。