Closed jawizie closed 7 years ago
This is more of a stack overflow question or just searching for how to load a js object with ajax from php and then looking at the xeditable examples. Maybe something like. http://stackoverflow.com/questions/30606614/angularjs-update-database-using-x-editable
Please close.
Thanks a lot still link helped
On Mon, Oct 31, 2016 at 4:41 PM, ckosloski notifications@github.com wrote:
This is more of a stack overflow question or just searching for how to load a js object with ajax from php and then looking at the xeditable examples. Maybe something like. http://stackoverflow.com/questions/30606614/angularjs- update-database-using-x-editable
Please close.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vitalets/angular-xeditable/issues/566#issuecomment-257311792, or mute the thread https://github.com/notifications/unsubscribe-auth/AWGPEY_mGG1Gpm2ahTmLNaWoeVCI5yItks5q5f4mgaJpZM4KlEkB .
OK, if my guidance has solved your issue, please close it.
well i have managed to follow that http://stackoverflow.com/questions/30606614/angularjs-update-database-using-x-editable im realising i cannot retrieve data posted from the form
Can you explain your issue some more, I don't follow.
i have managed to display data from my database in the text boxes(when i'm in edit mode) but i am unable to post edited form data to the database .
Are you getting an error?
no im not getting an errorbecause no data is posted from the form.
app.controller('ProfileFormCtrl', function($scope, $http) { $scope.display = function () { $http.get('../../core/scripts/insert.php') .success(function(data) { $scope.users = data; }); }; $scope.updateUser = function() { document.getElementById("message").textContent = ""; var request = $http({ method: "post", url: '../../core/scripts/clone.php', data: { 'name' :$scope.x.name, 'surname' :$scope.x.surname, 'dob' : $scope.x.dob, 'phone' : $scope.x.phone, 'national_id' : $scope.x.national_id, 'city' : $scope.x.city, 'about' : $scope.x.about }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
request.success(function (data) {
document.getElementById("message").textContent = "Post Successful"+data;
});
}
});
< editable-text="x.name" e-name="name" ></> this is how i have named the textboxes
< editable-form name="editableForm" ng-repeat="x in users" onaftersave="updateUser()">
yes updateUser is being called it is posting blank field values from what i deduced after adding some fake values in my back end i ran the function and it posted.I think the major issue is in the naming convention for values posted from edit mode as they are passed through function
As I stated above, where is x defined. Did you see what the value of your x object was in your updatUser method.
x is the value from ng-repeat="x in users" which is from my display() function and so in order for me to view the data in edit mode i had to maintain that value it is not defined in the script
Then you need to either pass x into your function or pass in an index number and use that to get the correct object from your list of users.
Created the object data posting succesfully to database but can no longer view the data in edit mode .Object name is user ..using the same name for the display() function object causes a conflict and no data is posted
Im trying to figure out how i can view database data in edit form im using php for my backend