データベースからangularjs ui-gridのサブグリッドにデータを入力しようとしていますが、機能していませんこれはコードです
`var User = $resource('/rest/daybook/sales_registertest/:id/?app_name=DAYBOOK_NEW&fields=*', {}, { update: { method: 'PUT' }, query: { method: 'GET', isArray : 間違い } });
var User1 = $resource('/rest/daybook/salesdetailtest/:id/?app_name=DAYBOOK_NEW&fields=*', {}, { update: { method: 'PUT' }, query: { method: 'GET', isArray:間違い } });
User.get(function(data) {
for(i = 0; i < data.record.length; i++){
var records;
var id=data.record[i].sales_id;
User1.get({
sales_id: id
}, function(resp) {
// Handle successful response here
records=resp.record;
console.log(records);
}, function(err) {
// Handle error here
});
//alert(id);
data.record[i].subGridOptions = {
columnDefs: [
{field:'sales_id'},
{field:'product_id'},
{field:'sale_qty'},
{field:'sale_price'},
{field:'sale_amount'},
{field:'product_id'} ,
{field:'updated_on'}
]
};
data.record[i].subGridOptions.data=records;
}
$scope.gridOptions.data=data.record; }、関数(エラー){
});`
what i need to do is ,to get the sub-grid according to the id of the row in main grid from a different table. how can i achieve this ??