jQuery 在另一个 SharePoint 2007 列表中查找列表列并在更改时插入值?
我在 SP 2007 中有一个带有表单的页面。我已将数据视图添加到该页面的另一个列表中,并使用 DIV 标记将其隐藏。该数据视图在带有 ID="WebPartWP 的 div 下显示为表格 Q3"
,但我在表本身上没有看到任何 ID。dataview 表看起来像这样。3 列(标题、主题、BodyPrefix),有 2 行数据:
<table TOPLEVEL border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top"><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPartWPQ3" width="100%" OnlyForMePart="true" allowDelete="false" style="" ><table id="issuetbl" border="0" width="100%" cellpadding="2" cellspacing="0" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"><tr valign="top"><th class="ms-vh" nowrap>Title</th><th class="ms-vh" nowrap>Subject</th><th class="ms-vh" nowrap>BodyPrefix</th></tr><tr class="ms-alternating"><td class="ms-vb">transcription error
#1</td><td class="ms-vb">subject for transciption error 1</td><td class="ms-vb"><div>prefex for transcription error 1</div></td></tr><tr><td class="ms-vb"> transcription error #2 </td><td class="ms-vb">SUBJECT FOR TRANSCRIPTION ERROR #2</td><td class="ms-vb"><div>BODY PREFIX 2222
</div></td></tr></table></div></td> </tr> </table>
有人有一个 jquery 函数吗?给定第一个 Title 列匹配,返回列单元格值(此处为 BodyPrefix)
那么,给定“转录错误 #2”,返回“BODY PREFIX 2222”
我开始这..但在xx没有得到任何东西。
$('#issuetbl tr').each(function() { var xx = $(this).find(".BodyPrefixCell").html(); }
I have a page with a form in SP 2007. I've added a dataview to another list to that page and hidden it using a DIV tag. That dataview shows up as a table under a div with ID="WebPartWP
, but I don't see any ID on the table itself. The dataview table looks like this. 3 columns (Title, Subject, BodyPrefix), with 2 rows of data:
Q3"
<table TOPLEVEL border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top"><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPartWPQ3" width="100%" OnlyForMePart="true" allowDelete="false" style="" ><table id="issuetbl" border="0" width="100%" cellpadding="2" cellspacing="0" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"><tr valign="top"><th class="ms-vh" nowrap>Title</th><th class="ms-vh" nowrap>Subject</th><th class="ms-vh" nowrap>BodyPrefix</th></tr><tr class="ms-alternating"><td class="ms-vb">transcription error
#1</td><td class="ms-vb">subject for transciption error 1</td><td class="ms-vb"><div>prefex for transcription error 1</div></td></tr><tr><td class="ms-vb"> transcription error #2 </td><td class="ms-vb">SUBJECT FOR TRANSCRIPTION ERROR #2</td><td class="ms-vb"><div>BODY PREFIX 2222
</div></td></tr></table></div></td> </tr> </table>
Does anybody have a jquery function that returns a column cell value (BodyPrefix here) given the first Title column match?
So , given "transcription error #2" return "BODY PREFIX 2222"
I started with this.. but not getting anything back in xx.
$('#issuetbl tr').each(function() { var xx = $(this).find(".BodyPrefixCell").html(); }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系..我明白了。必须在我的表中添加一个 id。
nevermind.. i got it. Had to add an id to my table.