Hello,

I have a ng-repeat that displays a list of items (<tr>'s). Each row has an 
accompanying ghost row, used to edit it's values. The ghost row is visible 
depending on the value of a scope key "editRow": ng-show="editRow". When I 
click an icon in the row, the ghostrow is shown. When I am done editing and 
and click another icon in te ghost row, a function "updateItem(item)" 
defined in the controller is called. From that function I want to be able 
to hide the ghost row again. I tried doing that by setting of 
$scope.editRow=false but that doesn't work

How can I do this?

This is my code:



*view:*    <tr ng-repeat-start="item in items | orderByPriority">

    <td><span class="glyphicon glyphicon-edit" 
ng-click="editRow=!editRow">&nbsp;</span>    <<=== when I click this icon, 
the ghost row below it is shown

    <tr ng-repeat-end ng-show="editRow"> <<== if editRow==true, this row is 
shown.
        <td class="span2"><span class="glyphicon glyphicon-save" 
ng-click="updateItem(item)">&nbsp;</span></td>
    </tr>


*controller:*
updateItem:

    $scope.updateItem = function(item){
        $rootScope.msg = "Please wait... Updating item '" + item.name + 
"'...";
        $rootScope.msgType = "info";
        $scope.editRow = false; <<== this should make the row disappear but 
it doesn't....
[... more code...]


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to