简体   繁体   English

jqGrid选定的行

[英]jqGrid Selected Row

I'm having issues with getting the correct row to select when using inline editing in jqGrid. 在jqGrid中使用内联编辑时,如何选择正确的行存在问题。 No matter which row I click, the last row is selected, then with each additional click, the row above is selected. 无论我单击哪一行,都会选择最后一行,然后每单击一次,就会选择上面的行。 After all rows have been selected, then I can click and select any row. 选择所有行之后,我可以单击并选择任何行。 Here is my code: 这是我的代码:

I'm using jqGrid 4.4.4 我正在使用jqGrid 4.4.4

 //url for inline edit
    editurl: "/Transactions/Modify",
    //event for inline edit

    onSelectRow: function (currentSelectedRow) {
        if (currentSelectedRow) { // && currentSelectedRow != $.lastSelectedRow
            //save changes in row 
            $('#grid').jqGrid('saveRow', $.lastSelectedRow, false);
            $.lastSelectedRow = currentSelectedRow;
        }


        currentSelectedRow,

    myEditParam = {
    keys: true,
    oneditfunc: function (id) { currentSelectedRow = id; },
    afterrestorefunc: function (id) { currentSelectedRow = undefined; }
    };

It's happens because the first column hasn't ID data. 发生这种情况是因为第一列没有ID数据。 Reorder columns or make first hidden ID column. 重新排序列或创建第一个隐藏的ID列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM