I have 2 HTML table. First column there are checkbox to check rows and when I click button on the top of the table it'll move data to another table. For example: Add members to the group by selecting the checkboxes in the table on the right and clicking “Add to Group”. To remove group members, select users in the table on the left and click “Remove from Group”. How can I do it. This's my screenshot
Asked
Active
Viewed 1,235 times
-3
-
2Why I downvoted this question: http://meta.stackexchange.com/a/149138/133242 – Matt Ball Mar 16 '13 at 01:09
-
please post your html code and what you have tried so far – ebram khalil Mar 16 '13 at 01:09
-
Now I have no idea for this problem. Can you help me? – Aka Shiro Mar 16 '13 at 01:10
2 Answers
1
I believe you want the .appendTo() function.
So get the selected row from the table with a suitable jquery selector, then use something like:
$('#selectedTR_goes_here').appendTo( $('#YourTable') );
appendTo() automatically detaches the element before reattaching elsewhere.
Note: this is also possible duplicate for: How to move an element into another element?
0
try this
$('class').each(function(){
if($(this).is(' checked'))
$('#otherTable tbody').append($(this).find().closest('tr).html());
});

PSR
- 39,804
- 41
- 111
- 151