如何将选定的行从一个表显示到另一个表 [英] how to show selected rows from one table to another table

查看:77
本文介绍了如何将选定的行从一个表显示到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张表在这里我想从数据库中获取值并显示在那里如果你点击每个值应该在另一个表中显示并显示在



假设在表1中



你好

hi

wel come



如果你点击你好

表2

hello应该来了,如果你点击它应该删除那里也有一个删除按钮

如何做到

i have a table here i want to get the values from database and show it there if u click on each value that value should display in another table and show on

suppose in table 1

hello
hi
wel come

if u click on hello
in table 2
hello should come and there is a remove button there also if u click that it should remove
how to do that

推荐答案

你需要为这种情况采取两个网格,一个用于从数据库中选择的显示数据,第二个用于从第一个网格中选择的显示数据。

在第一个网格中,您必须编写onrowcommand事件,并且在该事件中,您已获得选定的值并将其存储在临时表中。并将该临时表绑定到第二个网格。

对于删除你应该写第二个网格的事件并从临时表中删除选中的值。
You have to take two grids for that situation one for display data which is selected from database, and second for display data which is select from first grid.
In first grid you have to write onrowcommand event and in that event you have get selected value and store it in temporary table. and bind that temporary table to second grid.
And for remove you should write event for second grid and delete selected valued from temporary table.


你好,



这个问题的答案细节较少,



但如果你想什么都不做,那么这些步骤就是



1)创建MVC控制器和操作方法以显示表1的数据



2)创建服务方法来拉取表1数据,在表2中插入记录点击表1记录并删除表2中的记录。



3)创建客户端方法从表1和表2中提取详细信息服务器和显示给用户



4)创建客户端(Java脚本)事件处理程序来处理表1行选择并将行添加到第二个表。



5)创建客户端事件处理程序来处理删除链接点击并调用服务器方法来删除记录。



希望这会有所帮助。
Hello,

This question has less details to answer,

But if you want to no nothing then these are the steps

1) Create MVC controller and action method to display the data for the table 1

2) Create service methods to pull the table 1 data, insert record in table 2 on clicking table 1 record and delete record in table 2.

3) create client side method to pull the table 1 and table 2 details from server and display to the user

4) create client side(Java script) event handler to handle table 1 row selection and add the row to the the second table.

5) Create client side event handler to handle the delete link click and call server method to delete record.

Hope this will helps.


这篇关于如何将选定的行从一个表显示到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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