I have a button that calls a function to insert a record in my database, get the inserted record id and then insert the record in the grid with that id. But I'm not able to get to the next step of editing the record. The line with "editFirstCellInRow" returns an error:
grid.editFirstCellInRow is not a function
The row is getting created and it is getting past the "addClass" line. Do I need something else?
function service_add(grid)
{
$.ajax({
context: grid,
dataType: 'text',
url: "/utilities/ajax_add_service.php",
success: function (data) {
var id = data;
var rowIndx = 0;
today = today();
$("#services_grid").pqGrid("addRow", {newRow: {id: id, service_date: today}, rowIndx: rowIndx, rowIndxPage: 0});
grid.addClass({rowIndx: rowIndx, cls: 'pq-row-edit'});
grid.editFirstCellInRow({rowIndx: rowIndx});
//show the save button .
var $tr = grid.getRow({rowIndx: rowIndx}),
$btn = $tr.find("#saveservice");
$btn.button("option", {label: "Save", "icons": {primary: "ui-icon-check"}})
.unbind("click")
.click(function (evt) {
return service_save(rowIndx, grid);
})
.show();
}
});
}