Author Topic: Temporarily change column to editable when adding new row  (Read 1252 times)

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
Temporarily change column to editable when adding new row
« on: April 06, 2021, 12:43:48 am »
I'm adding new rows to the grid, but need to make certain non-editable columns editable in order to populate w/data, then set these columns back to non-editable.
Here's my JS to add the data/rows. How can I make the columns editable, add the data, then make then non-editable again.

                        var newRowList = [];
                        for (i = 0; i < rpmData.length; i++) {
                            newRowList.push({ newRow: rpmData });
                        }
                        $gridMain.pqGrid("addRow", { rowList: newRowList });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Temporarily change column to editable when adding new row
« Reply #1 on: April 06, 2021, 11:50:53 am »
It's easier to pass checkEditable parameter to addRow to bypass non-editable columns.

Code: [Select]
$gridMain.pqGrid("addRow", { rowList: newRowList, checkEditable: false });

Reference: https://paramquery.com/pro/api#method-addRow
« Last Edit: April 06, 2021, 11:54:22 am by paramvir »