我很难弄清楚如何在可编辑表格表单中访问多个表单。我的表单名称是“rowform”,我想访问控制器中所有表单的输入。我尝试使用 $scope.rowform 访问,但它返回“未定义”。这是我的表格。提前致谢
<tr ng-repeat="item in inv_row">
<td>
<!-- editable username (text with validation) -->
<span editable-select="item.inventory" e-name="inventory" e-form="rowform" buttons="no" e-placeholder="Select Inventory" e-ng-options="v.inventory_id as v.inventory_id for (k,v) in inventory_options track by k" e-ng-change="row_calc($data)">
@{{ show_inventory(item) }}
</span>
</td>
<td>
<!-- editable status (select-local) -->
<span editable-select="item.invoice_type" e-name="invoice_type" e-form="rowform" buttons="no" e-placeholder="Select Rent Type" e-name="status" e-ng-options="v as v for (k,v) in inv_type_options track by k">
@{{ show_invoice_type(item) }}
</span>
</td>
<td>
<span editable-textarea="item.desc" e-rows="1" e-name="desc" e-form="rowform" buttons="no" >
@{{ item.desc || 'no description' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.strt" e-name="strt" buttons="no" e-form="rowform" >
@{{ item.strt || 'empty' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.enddt" e-name="enddt" buttons="no" e-form="rowform">
@{{ item.enddt || 'empty' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.nodys" e-name="nodys" e-form="rowform" buttons="no">
@{{ item.nodys || 'empty' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.rate" e-name="rate" e-form="rowform" buttons="no">
@{{ item.rate || 'empty' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.disnt" e-name="disnt" e-form="rowform" buttons="no">
@{{ item.disnt || 'empty' }}
</span>
</td>
<td>
<!-- editable username (text with validation) -->
<span editable-text="item.netamt" e-name="netamt" e-form="rowform" buttons="no">
@{{ item.netamt || 'empty' }}
</span>
</td>
<td style="white-space: nowrap">
<!-- form -->
<form editable-form name="rowform" onaftersave="saveUser($data, item.id)" ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == item" >
<button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary">
save
</button>
<button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default">
cancel
</button>
</form>
<div class="buttons" ng-show="!rowform.$visible">
<!-- <button class="btn btn-primary" ng-click="rowform.$show()"><i style="font-size: 17px;font-weight: 300;" class="fa fa-pencil-square-o" aria-hidden="true"></i></button> -->
<button type="button" class="btn btn-primary" ng-click="rowform.$show()">edit</button>
<button class="btn btn-danger" ng-click="removeUser($index)"><i style="font-size: 17px;font-weight: 300;" class="fa fa-trash" aria-hidden="true"></i></button>
</div>