jqgrid不工作在IE8 [英] jqgrid not work on IE8

查看:667
本文介绍了jqgrid不工作在IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的下面的代码不工作在IE 8.
它的一个JQGrid(treegrid)从json服务器显示treegrid格式。它在firefox工作。

my below code not worked on IE 8. Its a JQGrid (treegrid) to display treegrid format from json server. it worked at firefox.

$(function () {
    "use strict";
    $("#tree").jqGrid({
        url: "http://myJSON-URL/",
        datatype: "json",

        colNames: ['id', 'Prestations'],
        colModel: [
                { name: 'id', width: 100, key: true, hidden: true },
                { name: 'name', width: 785, sortable: false }
            ],
        sortname: 'id',
        sortorder: "asc",
        hiddengrid: true,
        gridview: true,
        treeGrid: true,
        treeGridModel: "adjacency",
        ExpandColumn: 'name',
        ExpandColClick: true,
        jsonReader: { repeatitems: false, root: function (obj) { return obj; } },
        height: "auto"
    });
});

我认为它的AJAX cors问题。
任何想法?

I think its AJAX cors problem. Any idea? thanx.

json服务器端响应这些:

The json server side responsed these:

 json = [
{
    "id": "1",
    "name": "ECHANGEUR",
    "level": "0",
    "parent": "null",
    "isLeaf": false,
    "expanded": false,
    "loaded": true
},
{
    "id": "1_1",
    "name": "Intervention Aller sur Site",
    "level": "1",
    "parent": "1",
    "isLeaf": false,
    "expanded": false,
    "loaded": true
},
{
    "id": "1_1_1",
    "name": "Date et heure d'arrivée sur le site",
    "level": "2",
    "parent": "1_1",
    "isLeaf": true,
    "expanded": true,
    "loaded": true
},
{
    "id": "1_1_2",
    "name": "Consignation de l'échangeur",
    "level": "2",
    "parent": "1_1",
    "isLeaf": true,
    "expanded": true,
    "loaded": true
}

p>

推荐答案

您只是遇到了 jqGrid 4.7.x 的问题。您可以尝试使用不同版本的jqGrid和您发布的相同代码和JSON的树演示:

You have just the problem with the bug specific for jqGrid 4.7.x. You can try tree demos which uses different versions of jqGrid and the same code and JSON which you posted:

demo46 demo47 demo48 demo-free-jqGrid-GitHub

(最后一个使用我最近发布的免费jqGrid 4.8 ,请参阅此处此处)。

(The last one uses free jqGrid 4.8 which I published recently, see here and here).

您可以验证使用jqGrid 4.7的演示只在IE8中有问题,其他演示没有问题。您可以在此处这里

You can verify that the demo which uses jqGrid 4.7 only have the problem in IE8 and both other demos have no problem. You can read more about the bug here or here.

这篇关于jqgrid不工作在IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆