I am working on ui-grid and 306_expandable_grid, I used the exact code as in the document, but there was an error before the problem.
app.js
$http.get('resources/data/title2.json') .success(function(data){ console.log(data); console.log(data[0].Data); console.log(data.length); for(i = 0; i < data[i].length; i++){ data[i].subGridOptions = { columnDefs: [ {name:"Title" }, {name:"Jan-10" }, {name:"Feb-10"}, {name:"Mar-10" }, {name:"Apr-10" }, {name:"May-10" }, {name:"Jun-10" }, {name:"Jul-10" }, {name:"Aug-10" }, {name:"Sep-10" }, {name:"Oct-10" }, {name:"Nov-10" }, {name:"Dec-10" } ], data: data[i].Data } }
externalHtmlFile.html
<div ui-grid="row.entity.subGridOptions" style="height:150px;"></div>
this is a mistake I'm stuck with
TypeError: Cannot read property 'data' of undefined at new <anonymous> (http://localhost/ng-Grid/resources/scripts/ui-grid-unstable.js:2883:41) at Object.e [as invoke] (http://localhost/ng-Grid/resources/scripts/angular.min.js:36:456) at E.instance (http://localhost/ng-Grid/resources/scripts/angular.min.js:75:118) at http://localhost/ng-Grid/resources/scripts/angular.min.js:58:276 at r (http://localhost/ng-Grid/resources/scripts/angular.min.js:7:408) at M (http://localhost/ng-Grid/resources/scripts/angular.min.js:58:260) at http://localhost/ng-Grid/resources/scripts/angular.min.js:65:412 at http://localhost/ng-Grid/resources/scripts/angular.min.js:109:276 at h.$eval (http://localhost/ng-Grid/resources/scripts/angular.min.js:123:139) at h.$digest (http://localhost/ng-Grid/resources/scripts/angular.min.js:120:220)
when I click the plus icon, an error occurs ... I could not find a solution that I can understand. please, help
source share