I am trying to expand (my real example is very similar) angular -xeditable - Editable string example - the example described here: http://vitalets.imtqy.com/angular-xeditable/#editable-row or its jsFiddle link here: http: / /jsfiddle.net/NfPcH/93/
so I have another column to upload the file for each row / element. It is normal if it can only be an input element of a file of type, but I am open to other solutions. Usually my column looks like this:
<td> <span editable-text="template.description" e-name="description" e-form="rowform" e-required> {{ template.description || 'empty' }} </span> </td>
But now I want to add my custom column, and I tried the input element with or without all metioned attributes here:
<td> <input id="file" accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ng-show="rowform.$visible" class="btn btn-default" name="file" type="file" e-name="file" e-form="rowform" value="{{ user.file || 'empty' }}" /> </td>
In any case, I cannot get the value file in my angular controller after trying to save the line when this code is executed:
$scope.saveUser = function (data, id) { //$scope.user not updated yet angular.extend(data, { id: id }); angular.extend(data, { file: file }); return $http.post('/saveUser', data); };
My - data is an object here with all other properties, such as - description - but not with - file - property!
Of course, I expanded the onbeforesave form with:
... form editable-form name = "rowform" onbeforesave = "saveTemplate ($ data, user.id, user.file)" ...
Any suggestion?
Thank you Vedran
source share