jqGrid formatCell事件不存在';t火

jqGrid formatCell事件不存在';t火,jqgrid,Jqgrid,由于某种原因(我不知道)事件“formatCell”未触发(未显示警报消息)。见下面的代码: $("#jqgrid").jqGrid({ datatype: "json", colNames: ['CurrecncyID', 'Currency', 'Value', 'Calculated', 'Value', '%', 'Calculated'], colModel: [

由于某种原因(我不知道)事件“formatCell”未触发(未显示警报消息)。见下面的代码:

$("#jqgrid").jqGrid({
            datatype: "json",

            colNames: ['CurrecncyID', 'Currency', 'Value', 'Calculated', 'Value', '%', 'Calculated'],
            colModel: [
                        { name: 'CurrecncyID', index: 'CurrecncyID', hidden: true, width: 40 },
                        { name: 'CurrencyName', index: 'CurrencyName', width: 150 },
                        { name: 'FullPrice', index: 'FullPrice', width: 100, editrules: { custom: true, custom_func: priceCheck }, editable: true, align: 'right', formatter: priceFormatter },
                        { name: 'CalcFullPrice', index: 'CalcFullPrice', width: 100, align: 'right', formatter: priceFormatter },
                        { name: 'ActualPrice', index: 'ActualPrice', width: 100, editrules: { custom: true, custom_func: priceCheck }, editable: true, align: 'right', formatter: priceFormatter },
                        { name: 'Precent', index: 'Precent', width: 100, align: 'right', formatter: 'integer', formatoptions: { prefix: "% "} },
                        { name: 'CalcActualPrice', index: 'CalcActualPrice', width: 100, align: 'right', formatter: priceFormatter },
                    ],
            onSelectRow: function (id) {
                if (id && id !== lastsel) {
                    jQuery('#jqgrid').restoreRow(lastsel);
                    jQuery('#jqgrid').editRow(id, true);
                    lastsel = id;
                }
            },
            formatCell: function (rowid, cellname, value, iRow, iCol) {
                alert("before edit");
            },
            jsonReader: {
                repeatitems: false
            },
            rowNum: 20,
            rowList: [10, 20, 30],
            pager: '#jqpager',
            sortname: 'CurrecncyID',
            viewrecords: true,
            sortorder: "desc",
            caption: "Prices List",
            autowidth: true,
            height: "100%",
            loadtext: "Loading...",
            editurl: "/handlers/myurl.ashx"
        });`

jqGrid中使用了三种主要方法。这项活动是这次活动的一部分。如果使用editRow和restoreRow,则不会引发火灾。在使用内联编辑模式的情况下,您可能需要使用它。

jqGrid中使用了三种主要模式。这项活动是这次活动的一部分。如果使用editRow和restoreRow,则不会引发火灾。可能您需要在使用内联编辑模式时使用。

CurrecncyID拼写错误,您也应该使用javascript调试器来获取有关您的问题的更多信息,firefox中的调试器工作得很好。为了澄清这一点,您可以使用firefox中的Firebug等调试器来跟踪此类问题。谢谢,但不是这样。数据源也拼写错误:)我使用的是IE9开发工具工具栏,没有显示错误。CurrecncyID拼写错误,您也应该使用javascript调试器来获取有关您的问题的更多信息,firefox中的调试器工作得很好。为了澄清这一点,您可以使用firefox中的Firebug等调试器来跟踪此类问题。谢谢,但事实并非如此。数据源也拼错了:)我正在使用IE9开发工具,没有显示错误。