访问Angular xeditable中的所有表单

时间:2017-08-14 11:34:01

标签: angularjs x-editable angular-xeditable

我很难弄清楚如何在可编辑的表格中访问多个表单。我的表单名称是“rowform”,我想访问控制器中所有表单的输入。我试图使用$ scope.rowform进行访问,但它返回“undefined”。这是我的表格。提前致谢

<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>  

  

0 个答案:

没有答案