我正在使用MVC 3,EF Model First在我的项目上。使用Jquery和MVC3将表中的选定行添加到另一个表中
在我的看法我有4个看起来很喜欢这些的表。
<div class="questionsForSubjectType">
<table>
<thead>
<tr>
<th>
Title
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
test
</td>
</tr>
</tbody>
</table>
</div>
用户应该能够选择并添加到另一个表让说该表如下:
<table id="CustomPickedQuestions>
/* <----- Questions that users chose from the other tables /*
</table>
我所寻找的是,当一个用户在一排点击,该行应被删除并添加到CustomPickedQuestions
,当该行被添加到该表时,用户也应该能够从CustomPickedQuestions
Table
中删除它,然后该行将返回到之前的Table
。
我现在想知道如何在客户端jquery脚本的帮助下完成此任务。
是否要执行如下操作:http://jqueryui.com/demos/droppable/#shopping-cart? – Artem 2012-03-23 14:25:06
嗯,我正在寻找一些更有用的功能,就像我上面解释过的。后来它也假设能够删除自定义的问题。 – Obsivus 2012-03-23 14:32:02
那么,只需用jquery克隆克隆dom对象,然后追加jquery append,像'$(“。questionsForSubjectType tr”)。click(function(){$(this).clone()。appendTo(“#CustomPickedQuestions tbody“)}); ' - 当行点击它将被复制到目标表 – Artem 2012-03-23 14:36:49