Angularjs ng-grid REST calls -
folks,
i trying make ng-grid make rest calls upon editing.
i have followed clue post: angularjs , ng-grid - auto save data server after cell changed
however keep getting error, if has faced similar, pleas advice:
error: no controller: ngmodel @ error (<anonymous>) @ getcontrollers (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:4823:19) @ nodelinkfn (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:4960:35) @ compositelinkfn (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:4550:15) @ compositelinkfn (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:4553:13) @ publiclinkfn (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:4455:30) @ object.<anonymous> (http://www.yojit.com/app/lib/angular/ng-grid.js:2691:13) @ object.applyfunction [as fn] (http://www.yojit.com/app/#/employeelist:778:50) @ object.scope.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js:8811:27) @ object.$delegate.__proto__.$digest (http://www.mysite.com/app/#/employeelist:844:31) <input type="text" ng-class="'colt' + col.index" ng-input="row.entity.firstname" ng-blur="updateentity(col, row)">
my ng-grid looks this: in html file:
<div class="gridstyle" ng-grid="gridoptions"> </div>
in controller:
var nameeditabletemplate = "<input type=\"text\" ng-class=\"'colt' + col.index\" ng-input=\"col_field\" ng-blur=\"updateentity(col, row)\"/>"; $scope.gridoptions = { data: 'employees', columndefs: [ {displayname:'id', field:'id'}, {displayname:'first', field:'firstname',enablecelledit:true, editablecelltemplate:nameeditabletemplate }, {displayname:'middle', field:'middlename'} , {displayname:'last', field:'lastname'} ], enablecellselection: true, multiselect:false, }; //end of grid options
your missing ng-model template
var nameeditabletemplate = "<input type=\"text\" ng-class=\"'colt' + col.index\" ng-model=\"col_field\" ng-input=\"col_field\" ng-blur=\"updateentity(col, row)\"/>";
hope solves it
Comments
Post a Comment