Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery col width在jqgrid中使用,在chrome中可以完美工作,但在mozilla 33.0版本中无法工作_Jquery_Jqgrid - Fatal编程技术网

Jquery col width在jqgrid中使用,在chrome中可以完美工作,但在mozilla 33.0版本中无法工作

Jquery col width在jqgrid中使用,在chrome中可以完美工作,但在mozilla 33.0版本中无法工作,jquery,jqgrid,Jquery,Jqgrid,我在jqgrid中使用了以下内容,它在jqgrid中工作得非常好,但它并没有在mozilla 33.0中显示chrome中显示的内容 还有JavaScript代码 $(“#列表1”)。在(“jqGridSortCol”上,函数(e、sortName、iCol、sortOrder){ 警报(“sortName=“+sortName+”\niCol=“+iCol+”\nStorder=“+sortOrder”); //$(“#列表1”).trigger(“重新加载网格”); var myorde

我在jqgrid中使用了以下内容,它在jqgrid中工作得非常好,但它并没有在mozilla 33.0中显示chrome中显示的内容


还有JavaScript代码

$(“#列表1”)。在(“jqGridSortCol”上,函数(e、sortName、iCol、sortOrder){
警报(“sortName=“+sortName+”\niCol=“+iCol+”\nStorder=“+sortOrder”);
//$(“#列表1”).trigger(“重新加载网格”);
var myorder=排序器;
if(sortName==“idreleaseRequest”){
警惕(排序器);
var-ord=排序器;
警报(ord);
}
});
$(“#列表1”).jqGrid(“GridUnload”)
$(“#list1”).jqGrid({url:”./controllers/apGetTestData.php?testanzres=1&testsuite=“+testsuite+”&testcase=“+testcase+”&ch=“+ch+”&fromdate=“+fromdate+”&todate=“+todate+”&mmss=“+mmss,datatype:'xml',mtype:'GET',height:'auto,”,
colname:[“RRID”、“发布标签”、“完成日期”、“结果”、“固件”、“DUT”、“摘要”、“备注”],
colModel:[
{名称:'idreleaseRequest',索引:'idreleaseRequest',宽度:80,排序类型:'int'},
{名称:'releaseRequestTag',索引:'releaseRequestTag'},
{名称:'DateInfo',索引:'Date Info'},
{name:'Result',index:'Result',sortable:false},
{name:'FirmWare',index:'FirmWare',sortable:false},
{name:'DUT',index:'DUT',sortable:false},
{name:'Summary',index:'Summary',sortable:false,align:'left'},
{name:'comments',index:'Total Suites',sortable:false}],
传呼机:$('pager1'),
rowNum:6,
行列表:[6,12,18,24],
sortname:'idreleaseRequest',
巫师:“描述”,
描述:“测试结果:”+globalData,
高度:“自动”,
viewrecords:是的,
gridview:没错,
标题:“测试”,
行数:对,
shrinkToFit:错,
希德尔格:是的
});
$('#list1').jqGrid(“setLabel”、“rn”、“SNo”);
$(“#列表1”)。在(“jqGridAfterLoadComplete jqGridRemapColumns”,函数(){
变量$this=$(this),
$cells=$this.find(“>tbody>tr>td”),
$colHeaders=$this.closest(“.ui-jqgrid-view”).find(“>.ui-jqgrid-hdiv>.ui-jqgrid-hbox>.ui-jqgrid-htable>thead>.ui-jqgrid-labels>.ui-th-column>div”),
colModel=$this.jqGrid(“getGridParam”,“colModel”),
国际古迹遗址理事会,
伊罗,
排,
一行
n=$.isArray(colModel)?colModel.length:0,
厘米
colWidth,
idColHeadPrexif=“jqgh_u“+this.id+”;
$cells.wrapInner(“”);
$colHeaders.wrapInner(“”);
对于(iCol=0;iCol.mywrapping”).outerWidth()+25;//25px用于排序图标
for(iRow=0,rows=this.rows;iRow
这是我在jqgrid中使用的全部代码,它在chrome中工作得非常好,并且它在chrome中正确地显示了我期望的内容,但是在Mozilla 33.0中,它没有正确地显示chrome中显示的内容。请任何人在这方面帮助我,提前谢谢

function  ShowHideColumn () {
                $.extend(true, $.ui.multiselect, {
                locale: {
                    addAll: 'Make all visible',
                    removeAll: 'Hide All',
                    itemsCount: 'Avlialble Columns'
                }
            });
            $.extend(true, $.jgrid.col, {
                width: 450,
                modal: true,
                msel_opts: {dividerLocation: 0.5},
                dialog_opts: {
                    minWidth: 470,
                    show: 'blind',
                    hide: 'explode'
                }
            });
          $("#list1").jqGrid("setColProp", "rn", {hidedlg: false});
         $('#list1').jqGrid('columnChooser',
         {

            done: function(perm) {
               if (perm) { self.jqGrid("remapColumns", perm, true); }       

        }
         });


}

首先:您在演示中使用了错误的HTML标记:


应该固定到


永久使用
index
值的秒数与
name
值不同(
{name:'FirmWare',index:'name'}
我严格建议您从
colModel
中删除所有
index
属性。使用
索引
值,这些值与列中网格分段排序的
名称
值不同

第三:即使在我的计算机(Windows 7)上安装了之后,我也无法重现您的问题:加载后,所有列的宽度似乎都是正确的。如果我按Asc或Desc方向的最后一列排序,我也会得到所有列的正确宽度值

更新:在我看来,通过在
cm=colModel[iCol]行之后添加
if(cm.hidden){continue;}
来固定实现基于最大列包含的列宽度设置的代码

$("#list1").on("jqGridAfterLoadComplete jqGridRemapColumns", function () {
    var $this = $(this),
        $cells = $this.find(">tbody>tr>td"),
        $colHeaders = $this.closest(".ui-jqgrid-view").find(">.ui-jqgrid-hdiv>.ui-jqgrid-hbox>.ui-jqgrid-htable>thead>.ui-jqgrid-labels>.ui-th-column>div"),
        colModel = $this.jqGrid("getGridParam", "colModel"),
        iCol,
        iRow,
        rows,
        row,
        n = $.isArray(colModel) ? colModel.length : 0,
        cm,
        colWidth,
        idColHeadPrexif = "jqgh_" + this.id + "_";
    $cells.wrapInner("<span class='mywrapping'></span>");
    $colHeaders.wrapInner("<span class='mywrapping'></span>");

    for (iCol = 0; iCol < n; iCol++) {
        cm = colModel[iCol];
        if (cm.hidden) {
            continue;
        }
        colWidth = $("#" + idColHeadPrexif + $.jgrid.jqID(cm.name) + ">.mywrapping").outerWidth() + 25; // 25px for sorting icons
        for (iRow = 0, rows = this.rows; iRow < rows.length; iRow++) {
            row = rows[iRow];
            if ($(row).hasClass("jqgrow")) {
                colWidth = Math.max(colWidth, $(row.cells[iCol]).find(".mywrapping").outerWidth());
            }
        }
        $this.jqGrid("setColWidth", iCol, colWidth);
    }
});
$(“#列表1”)。在(“jqGridAfterLoadComplete jqGridRemapColumns”,函数(){
变量$this=$(this),
$cells=$this.find(“>tbody>tr>td”),
$colHeaders=$this.closest(“.ui-jqgrid-view”).find(“>.ui-jqgrid-hdiv>.ui-jqgrid-hbox>.ui-jqgrid-htable>thead>.ui-jqgrid-labels>.ui-th-column>div”),
colModel=$this.jqGrid(“getGridParam”,“colModel”),
国际古迹遗址理事会,
伊罗,
排,
一行
n=$.isArray(colModel)?colModel.length:0,
厘米
colWidth,
idColHeadPrexif=“jqgh_u“+this.id+”;
$cells.wrapInner(“”);
$colHeaders.wrapInner(“”);
对于(iCol=0;iCol.mywrapping”).outerWidth()+25;//25px用于排序图标
for(iRow=0,rows=this.rows;iRow

请参阅。

您是否使用测试版Mozilla Firefox 33测试了代码?Firefox的当前发布版本是32.0.2。您在Mozilla 33中编写了“它没有正确显示”。到底什么是不正确的?你能从中重现问题吗?您的演示仍然使用
name
和空格
name:'Firm-Ware'
,这是不推荐的。这是图片内容的链接