html5 - ui-grid not showing data angularjs -
can please me. want implement data display using ui-grid. grid not displaying data showing blank yet when use table <tr ng-repeat="transaction in savingaccountdetails.transactions>
data displayed.
i want use ui-grid because of ability have fixed header while scrolling large data hard make table header fixed, times columns don't align. tried cases not working expected.
my codes below:-
var columnsuigrid = [ { displayname: 'value date', field: 'accountdetails.transactions.date'}, { displayname: 'seq', field: 'accountdetails.transactions.id'}, { displayname: 'number', field: 'accountdetails.transactions.transactioncode'}, { displayname: 'type', field: 'accountdetails.transactions.transactioncode'}, { displayname: 'debit', field: 'accountdetails.transactions.amount'}, { displayname: 'credit', field: 'accountdetails.transactions.amount'}, { displayname: 'balance', field: 'accountdetails.transactions.runningbalance'}, { displayname: 'tlr#', field: 'accountdetails.transactions.teller'}, { displayname: 'reference', field: 'accountdetails.transactions.referencecode'}, { displayname: 'description', field: 'accountdetails.transactions.description'} ]; scope.gridoptions = { columndefs: columnsuigrid, enablesorting: false, enablecolumnmenus: false, enablerowselection: true, enablerowheaderselection : false, multiselect: false, data: 'accountdetails' }; resourcefactory.savingsresource.get({accountid: routeparams.id, associations: 'all'}, function (data) { scope.accountdetails = data; });
from above following errors web browser console:- when use quotes i.e 'accountdetails' error below:-
angular.js:9400 typeerror: d.$applyasync not function @ h (http://localhost:9000/bower_components/angular-ui-grid/ui-grid.min.js:7:2757) @ post (http://localhost:9000/bower_components/angular-ui-grid/ui-grid.min.js:7:4152) @ http://localhost:9000/bower_components/angular/angular.js:6602:44 @ nodelinkfn (http://localhost:9000/bower_components/angular/angular.js:6224:13) @ http://localhost:9000/bower_components/angular/angular.js:6414:13 @ http://localhost:9000/bower_components/angular/angular.js:7559:11 @ wrappedcallback (http://localhost:9000/bower_components/angular/angular.js:10930:81) @ http://localhost:9000/bower_components/angular/angular.js:11016:26 @ scope.$eval (http://localhost:9000/bower_components/angular/angular.js:11936:28) @ scope.$digest (http://localhost:9000/bower_components/angular/angular.js:11762:31) <div ui-i18n="en" class="influxgrid ui-grid ng-isolate-scope grid1505208757076" id="transactiongrid" ui-grid-selection="" ui-grid="gridoptions" style="height: 340px;"> (anonymous) @ angular.js:9400 (anonymous) @ angular.js:6836 nodelinkfn @ angular.js:6227 (anonymous) @ angular.js:6414 (anonymous) @ angular.js:7559 wrappedcallback @ angular.js:10930 (anonymous) @ angular.js:11016 $eval @ angular.js:11936 $digest @ angular.js:11762 $apply @ angular.js:12042 (anonymous) @ angular.js:13575 completeoutstandingrequest @ angular.js:4109 (anonymous) @ angular.js:4416 angular.js:9400 typeerror: b.foreach not function @ p.modifyrows (ui-grid.min.js:7) @ ui-grid.min.js:7 @ wrappedcallback (angular.js:10930) @ angular.js:11016 @ scope.$eval (angular.js:11936) @ scope.$digest (angular.js:11762) @ scope.$apply (angular.js:12042) @ angular.js:13575 @ completeoutstandingrequest (angular.js:4109) @ angular.js:4416
i don't know why using scope "scope" , not "$scope". couldn't problem maybe if try code way:
var columnsuigrid = [ { displayname: 'value date', field: 'accountdetails.transactions.date'}, { displayname: 'seq', field: 'accountdetails.transactions.id'}, { displayname: 'number', field: 'accountdetails.transactions.transactioncode'}, { displayname: 'type', field: 'accountdetails.transactions.transactioncode'}, { displayname: 'debit', field: 'accountdetails.transactions.amount'}, { displayname: 'credit', field: 'accountdetails.transactions.amount'}, { displayname: 'balance', field: 'accountdetails.transactions.runningbalance'}, { displayname: 'tlr#', field: 'accountdetails.transactions.teller'}, { displayname: 'reference', field: 'accountdetails.transactions.referencecode'}, { displayname: 'description', field: 'accountdetails.transactions.description'} ]; $scope.gridoptions = { columndefs: columnsuigrid, enablesorting: false, enablecolumnmenus: false, enablerowselection: true, enablerowheaderselection : false, multiselect: false, data: $scope.accountdetails }; resourcefactory.savingsresource.get({accountid: routeparams.id, associations: 'all'}, function (data) { $scope.accountdetails = data; });
please let know more details problem
Comments
Post a Comment