Angularjs Inline Edit example – AngularJs update and save table Row Examples
In this Post We Will Explain About is Angularjs Inline Edit example With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to AngularJs update and save table Row ExamplesExample
In this post we will show you Best way to implement Edit row in angularjs table, hear for Creating simple inline editing with AngularJSwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!. I have the following angularjs Simple table with an edit button and save Button Examples
Include Script and Module
[php]
var liveApp = angular.module(“liveApp”, []);
[/php]
Json Data using Angularjs
[php]
$scope.clientList = [{‘id’:11, ‘clientname’:’mayur’,’place’:’USA’}, {‘id’:10, ‘clientname’:’Kelly’,’place’:’Australia’}, {‘id’:1, ‘clientname’:’Rimmy’,’place’:’India’}, {‘id’:101, ‘clientname’:’Kat’,’place’:’Serbia’}, {‘id’:190, ‘clientname’:’Yesha’,’place’:’Srilanka’}, {‘id’:189, ‘clientname’:’Robert’,’place’:’India’}];
[/php]
Angularjs Custom Add Template
[php]
[/php]
Full Example of Angularjs Inline Edit example
[php]
var liveApp = angular.module(“liveApp”, []);
liveApp.controller(“liveCtrl”, function($scope) {
$scope.updaterow = ”;
$scope.clientList = [{‘id’:11, ‘clientname’:’mayur’,’place’:’USA’}, {‘id’:10, ‘clientname’:’Kelly’,’place’:’Australia’}, {‘id’:1, ‘clientname’:’Rimmy’,’place’:’India’}, {‘id’:101, ‘clientname’:’Kat’,’place’:’Serbia’}, {‘id’:190, ‘clientname’:’Yesha’,’place’:’Srilanka’}, {‘id’:189, ‘clientname’:’Robert’,’place’:’India’}];
$scope.editContent = function(mydata) {
$scope.updaterow = angular.copy(mydata);
}
$scope.loadTemplate = function(mydata) {
if (mydata.id === $scope.updaterow.id) return ‘edit’;
else return ‘view’;
}
$scope.saveData = function (indx) {
$scope.clientList[indx] = angular.copy($scope.updaterow);
$scope.reset();
};
$scope.reset = function(){
$scope.updaterow = [];
}
});
ClientName | Places | Actions |
---|---|---|
[/php]
I hope you have Got What is Creating simple inline editing with AngularJS or AngularJs update and save table Row Examples And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.