The 'addRow' method allows to add a new editing row and the user can enter something to edit it. To add a new row directly to the database, you should post it and then refresh the datagrid data.
$.post(..., function(){
$('#dg').datagrid('reload');
})