简体   繁体   中英

jqGrid Selected Row

I'm having issues with getting the correct row to select when using inline editing in 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

 //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. Reorder columns or make first hidden ID column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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