This is very simple example of how you can add a record in an interactive grid using Javascript. This example can be enhanced to incorporate complex business needs. this the basic. viewers find many ways to enhance the concept.
///Java Script Code
////////////////////////////
function addToIg() {
// IG region static ID
var $widget = apex.region('DEMO').widget();
var $grid = $widget.interactiveGrid('getViews', 'grid');
var $model = $grid.model;
var vname = $v('P39_NAME');
//insert new record on a model
var newRecordId = $model.insertNewRecord();
//get the new record
var $newRecord = $model.getRecord(newRecordId);
//update record values
$model.setValue($newRecord, 'NAME', vname);
}