使用jQuery将表格数据更改为另一个表 [英] Changing the tabular data to another table using jquery

查看:69
本文介绍了使用jQuery将表格数据更改为另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图实现通过单击按钮在表中显示数据.现在,我正在尝试将数据从表移动到继续表下面.在这段代码中,当我输入json对象的输入值并单击Submit按钮时,数据将显示在一个带有Continue按钮的表中,并在下面显示一个空表.位于继续按钮下方.这是我的代码[示例http://jsfiddle.net/e254w/6/]有人可以提出实现该方案的想法吗?

I tried to implement to display data in a table with the button click. Now I am trying to move the data from the table to the below the continue table. In this code, when I enter the input value from the json object and click the submit button, data will display in a table with a continue button and a empty table below.When I click continue the data in the above table should move to table which is located below the continue button. Here is my code [Sample http://jsfiddle.net/e254w/6/] Can anyone please suggest the idea of implement the scenario?

克里希(Krish)

推荐答案

一种解决方法是从第一个表中删除该行并将其追加到第二个表中.

One way to approach this would be to remove the row from the first table and append it to the second.

此行在第一张表中查找第二行,如果存在则将其删除,并将其附加到第二张表中.

This line finds the second row in the first table, removes it if it exists and appends it to the second table.

$('#datatable').find('tr').eq(1).remove().appendTo($('#seconddatatable'));

更新了小提琴

更新的小提琴-首先输入122233334444,然后输入122223355552

Updated fiddle - this works for me first entering 122233334444, then entering 122223355552

这篇关于使用jQuery将表格数据更改为另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆