Bug Tracker

Opened 11 years ago

Closed 10 years ago

#3740 closed bug (invalid)

Clone the object Error

Reported by: zhuisha Owned by:
Priority: major Milestone: 1.3
Component: unfiled Version: 1.2.6
Keywords: Cc: zhuisha
Blocked by: Blocking:

Description

(Sorry to my poor English,So I'll give you chinese edition go with English edition.) 我使用JQuery来构造一个基于简单模板的动态表格,模板的风格是这样的: I use Jquery as my libraty to build a simple dynamic table with template,the template is below:

<table id="tblDataTable" width="100%" border="0" cellspacing="0" cellpadding="2">

<colgroup>

<col width="40" /> <col width="40" /> <col width="60" /> <col width="*" /> <col width="120" /> <col width="135" />

</colgroup> <thead>

<tr>

<td class="ListTitle">

<input type="checkbox" id="checkbox1" name="checkbox1" title="全选" value="全选" />

</td> <td class="ListTitle">

缓急

</td> <td class="ListTitle">

发件人

</td> <td class="ListTitle">

主题

</td> <td class="ListTitle">

文号

</td> <td class="ListTitle">

发件时间

</td>

</tr>

</thead> <tbody>

<tr valign="bottom">

<td>

<input type="checkbox" />

</td> <td>

sHJ

</td> <td>

sSender

</td> <td>

sBH

</td> <td>

sFWZH

</td> <td>

sDateTimeReceived

</td>

</tr>

</tbody>

</table>

这个table的tbody里面只有一行,这行作为我的内容模板, 在我动态生成表格的时候.先把行模板作为jQuery对象通过Data()缓存下来,然后删除掉行模版,在生成行的时候通过clone方法把缓存的数据复制下来.然后替换掉模板中的数据.BUG是,我第一次取出的行模板的children("td:gt(0)")返回的jQuery中只有一个td,事实情况是我有6个td,随后再取出的行模板就可以正常操作了.我只好在需要行模板的时候先取出一次丢弃.随后取出的再使用. (There's only one row in tbody of this table, It's just my simple template and when I generate rows for this Grid,I cache the simple template row (as a jQuery object) use Data method of jQuery, then delete this template row.The data is coming so I get my template (as a jQuery object) with the clone method in jQuery. My template have 6 TD but with the method I can get only 0 with template.children("td") when I clone the cache template first time (and only the first time). I had to get the template's clone once and throw it and use the next clone.I use visual studio 2008 and jQuery 1.2.6 edition,I debug it step and step and once by once but the error is still. My email address is xiaoqianglinsen@…. Thanks for your dilicious jQuery.

Merry Chiristmas Day A Honest Programmer Lee

Attachments (4)

WFlowNew.aspx (6.1 KB) - added by zhuisha 11 years ago.
This is the ErrEdition.
error edition data.JPG (37.4 KB) - added by zhuisha 11 years ago.
The result of error edition.
WFlowNew.2.aspx (6.2 KB) - added by zhuisha 11 years ago.
right edition.
riht edition result.JPG (43.7 KB) - added by zhuisha 11 years ago.
The result of right edition.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by zhuisha

Attachment: WFlowNew.aspx added

This is the ErrEdition.

Changed 11 years ago by zhuisha

Attachment: error edition data.JPG added

The result of error edition.

Changed 11 years ago by zhuisha

Attachment: WFlowNew.2.aspx added

right edition.

Changed 11 years ago by zhuisha

Attachment: riht edition result.JPG added

The result of right edition.

comment:1 Changed 11 years ago by flesler

Cc: zhuisha added
Owner: flesler deleted

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

Sorry but I cannot understand the issue given the partial code and description. Asking for help on a Chinese forum would probably be the best way to resolve the issue. If there is actually a jQuery bug lurking here, please reopen and attach a complete test case file with script and html.

Note: See TracTickets for help on using tickets.