Add new row with a default value

1k views Asked by At

I'm using the following code to fill one of the cells of a new row with a default value, but this is not working (the cell is empty). Is this code ok?

var parameters =
                {
                    rowID: "new_row",
                    initdata: {
                        IdField: $('#IdField').val(),
                        Description: $('#IdField option:selected').text()
                    },
                    position: "first",
                    useDefValues: false,
                    useFormatter: false,
                    addRowParams: { extraparam: {} }
                };

            $("#containerGrid").jqGrid('addRow', rowid, parameters);
1

There are 1 answers

0
juliano.net On BEST ANSWER

Problem solved by removing the rowid parameter from the addRow method.

$("#containerGrid").jqGrid('addRow', parameters);