如何将选定的行从一个引导表复制到另一引导表,并使用添加和删除btn撤消操作,并在.net core 2.1中使用js保存第二个表

时间:2018-12-22 10:17:00

标签: javascript core asp.net-core-2.1

我是javascript的新手,我必须要用最多的表来添加和删除按钮在它们之间传输数据,最后我要用提交按钮保存第二个表数据。 谁能帮我这两个表的js吗?

                    <table id="sugested" class="table table-bordered table-striped table-sm"
                           >
                        <thead class="text-right">
                            <tr id="tr1">
                                <th data-field="state" data-checkbox="true"></th>
                                <th data-field="Name" class="text-right">name</th>
                                <th data-field="SpecialIllId" data-visible="false" class="hidden"></th>
                            </tr>
                        </thead>
                        <tbody class="text-right">
                            @foreach (var r in Model.sugestedIlls)
                            {
                                <tr id="tr3" class="text-right">
                                    <td data-field="state" data-checkbox="true"></td>
                                    <td data-field="Name">@r.Name</td>
                                    <td data-field="SpecialIllId">@r.SpecialIllId</td>
                                </tr>
                            }
                        </tbody>
                    </table>
                <a id="add" class="btn btn-primary "> add </a>
                <a id="remove" class="btn btn-primary "> remove </a>
                    <table id="assigned" class="table table-bordered table-striped table-sm">
                        <thead class="text-right">
                            <tr>
                                <th data-field="state" data-checkbox="true"></th>
                                <th data-field="Name" class="text-right">name</th>
                                <th data-field="SpecialIllId" data-visible="false" class="hidden"></th>
                            </tr>
                        </thead>
                        <tbody class="text-right">
                            @foreach (var r in Model.asighnedIlls)
                            {
                                <tr id="tr2">
                                    <td data-field="state" data-checkbox="true"></td>
                                    <td data-field="Name">@r.Name</td>
                                    <td data-field="SpecialIllId">@r.SpecialIllId</td>
                                </tr>
                            }
                        </tbody>
                    </table>

0 个答案:

没有答案