2016-03-02 232 views
0

我有一个可编辑的表格enter image description here它工作正常,但我必须隐藏可编辑的行,并显示在按钮上点击 例如。我怎么能做到这一点?angularjs的可编辑表格

<td contenteditable='true'> 
         <label class="text"> 
           <input type="text" ng-model="medication.description" ng-change="editMedication(medication)"/> 
          {{medication.description}} 
         </td> 
         <td> 
          <label for="edit"> 
           <input type="button" id = "edit" ng-model="medication" ng-change="editMedication(medication)" > 
          </label> 
         </td> 
         </tr> 
       </table> 
+0

加上'NG-IF = “_ show_editable_row ==真正的”'中的标记,并在控制器添加'$ scope.show_editable_row = function(){$ scope._show_editable_row = true; ''。在按钮上添加'ng-click =“show_editable_row();”' –

+0

完成了,但仍然没有隐藏 –

+0

检查控制台,可能有语法错误。我在我的项目中使用它。 –

回答

0

你应该使用angular-xeditable,利用这一点,你将能够创建表Editable columnEditable rowEditable table