0

Is that possible to retrieve the value from the jqgrid afterinsertrow function? I tried to alert the data but it displays "undefined":

function(rowid,data){
   alert(data.Name); // "Name" is my column name
}
user1429833
  • 11
  • 2
  • 3

2 Answers2

1

The afterInsertRow executes only when the grid parameter gridview is false

$("#grid").jqGrid({
    ...
    gridview : false,
    afterInsertRow : function( rowid, rowdata, rawdata) {
        // do something
    }
});

By default this parameter is true

P.S Added example. Please check this demo

Tony Tomov
  • 3,122
  • 1
  • 11
  • 18
0

This may not be an answer but the example I created here http://jsfiddle.net/8dYNq/ could give you some idea.

You will get the data via afterInsertRow event args when initializing the jqGrid. But when + icon is clicked, it will insert a blank row. Hence field values are undefined. Please look at console log for details.

Anil Vangari
  • 570
  • 7
  • 12