小编Edu*_*gue的帖子

无法获取JQGrid loadComplete事件

我正在尝试在加载网格后模拟第一个单元格上的单击.我已经知道如何实现这一点,但由于某种原因,我无法触发"loadComplete"事件.我添加了一个带有单个警报的简单函数来试用它,但即使页面加载没有问题,我也没有收到警报(并且调试显示函数永远不会被调用).

"gridComplete"也不起作用.

我正在使用jgGrid 3.8.2

关于我做错了什么的任何想法?我在下面发布了我的代码:

    $(document).ready(function () {
        $("#grid").jqGrid(
            {
                datatype: function () {
                    $.ajax(
                    {
                        type: "POST",
                        url: "Default.aspx/GetListOfPersons",
                        data: "{}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (jsondata, stat) {
                            if (stat == "success")
                                jQuery("#grid")[0].addJSONData(JSON.parse(jsondata.d));
                            else
                                alert("error");
                        }
                    });
                },
                jsonReader:
                {
                    root: "rows",
                    page: "page",
                    total: "total",
                    records: "records",
                    repeatitems: false,
                    id: "Id"
                },
                colModel: //Columns
                [
                    { name: 'FirstName', index: 'FirstName', width: 200, align: 'Left', label: 'First Name', editable: true },
                    { name: 'LastName', index: 'LastName', …
Run Code Online (Sandbox Code Playgroud)

jquery jqgrid

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

jqgrid ×1

jquery ×1