You need to register the subgrid APIs. Each grid has its own separate instance of the API, which you use to communicate with it:
rowScope.subGridOptions = { appScopeProvider: $scope, columnDefs: [ {field: 'amount'}, {field: 'packageAmount'}, {field: 'carrierAmount'} ], data: rowScope.orderLines, saveRow : $scope.saveRow, onRegisterApi: function (gridApi) { gridApi.rowEdit.on.saveRow($scope, $scope.saveRow) } }
This is close, but you enter our controller area into the subgrade area using appScopeProvider, which you really don't need to do. Instead, we can create a generRow generic and bind it to the gridApi we want. The first argument to bind() sets this to the function. We just pass the mesh object, but we don’t need it. The second argument to bind will be the gridApi we want to pass. Then in the definition of saveRow we know that we will get the right API as the first argument, and then rowEntity as the second arg.
Since you will probably have a different save function for your subgrid, the main thing to remember is to register the "saveRow" event on all of them using onRegisterApi
Here's a working plunk showing the code above: http://plnkr.co/edit/52mp9C?p=preview
source share