2016-03-02 229 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