我现有个显示日历的 Table,以某一个月的日历显示如下:星期日 星期一 星期二 星期三 星期四 星期五 星期六
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 当我用鼠标随意选中几行几列数据库.用JS我该怎么样去获取我得选择的数据?
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 当我用鼠标随意选中几行几列数据库.用JS我该怎么样去获取我得选择的数据?
解决方案 »
- 如何同步两个数据库
- 很简单的关于jQuery的ajax的问题
- 推荐BBS论坛
- |M| Post学习 接收页面接收不到
- 请问我刚学asp.net 开发环境是装visual studio2003 还是visual studio2005好啊?
- 生成网站时报“曾经运行该线程的应用程序域已卸载”怎么解决?
- 为什么做一个DataGrid控件就出现这样的错误
- How to response the checkbox's click event in a DataGrid control?
- 请教:DataGrid多级关联显示?
- 怎么把一个网页上的内容(包括文字和表格)以word格式或者pdf格式保存保存到客户端
- 如何在ASP.NET后台脚本中弹出登录的窗口?
- 问一下 谁做过视频中插播广告的?
最后把array里面的数据取出来就是你要的了。
比如点击事件on_td_click(this);
就行了~
string str_sbody = ""; str_sbody = "<table cellSpacing=0 cellPadding=0 width=860 align=right border=2>" +
"<tr>" +
"<td colspan=33 height=10></td>" +
"</tr>";
str_sbody = str_sbody + "<tr>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center width=50>姓名</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center width=100>部门名称</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2>1</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>2</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>3</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>4</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>5</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>6</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>7</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>8</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>9</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>10</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>11</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>12</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>13</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>14</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>15</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>16</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>17</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>18</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>19</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>20</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>21</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>22</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>23</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>24</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>25</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>26</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>27</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>28</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>29</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>30</td>" +
"<td class=STYLE5 bgColor=#e7e7e7 align=center colspan=2 width=2%>31</td>" +
"</tr>";
string user = p.getRequestUser;
string ram = p.getRequestRandom;
for (int i = 0; i < dv.Table.Rows.Count; i++)
{
if (run == 2) //显示排班
{
str_sbody = str_sbody + "<tr>" +
"<td align=center rowspan=2 class=STYLE7 width=40 height=40><a href ='KQPsn.aspx?User=" + user + "&Random=" + ram + "&psncode=" + dv.Table.Rows[i].ItemArray[0].ToString() + "' target='_blank'>" + dv.Table.Rows[i].ItemArray[1].ToString() + "</a></td>" +
"<td align=center rowspan=2 class=STYLE7 width=100 height=40>" + dv.Table.Rows[i].ItemArray[2].ToString().Replace("集团", "") + "</td>";这是我写的一部分。
你可以参考一下。不过TABle是在后代产生的,这样可以自己写对应的事件。