[英]finding client ID's of table of listview webpart
short: A listview
webpart contains a table with an ID composed of two GUID's
, how do I find these? 简短说明:一个
listview
Webpart包含一个表,该表的ID由两个GUID's
组成,如何找到它们?
I am working on adding some additional behaviour to a standard sharepoint listview-webpart
. 我正在努力向标准
sharepoint listview-webpart
添加一些其他行为。
Preferably I don't want to actually edit the webpart
itself. 最好我不想真正编辑
webpart
本身。 I want to put javascript
in a helper webpart to add some onclick
events to the table rows which pass the values of the id
and status columns to the helper webpart
, which then displays some buttons depending on the row's status. 我想将
javascript
放在帮助器Webpart中,以向表行添加一些onclick
事件,这些事件将id
和status列的值传递给帮助器webpart
,然后根据行的状态显示一些按钮。
I searched around to see how others tackled this problem, and usually they use the webpart
container div
with ID WebPartWPQ _n_
". The problem is that these webparts
are going to be used on lots of sites, and I have no way of knowing the value of _n_
. 我找遍四周,看看别人是怎么解决这个问题,他们通常使用
webpart
容器div
ID为WebPartWPQ _n_
”。问题是,这些webparts
将要在很多网站的使用,我没有办法知道的值的方法的_n_
。
A bit further down in the hierarchy is the main table of the view, and it also has an ID
. 视图的主表位于层次结构的更下方,还具有
ID
。 In my test-case: {BF3FB0FA-7E7F-4920-A326-B5E46826B693}-{BD0777BD-455D-4554-A80E-8A11D990D1A5}
在我的测试用例中:
{BF3FB0FA-7E7F-4920-A326-B5E46826B693}-{BD0777BD-455D-4554-A80E-8A11D990D1A5}
I figured these two guids
must stand for something and could possibly be looked up. 我认为这两个
guids
必须代表某种东西,并且可能会被查找。
So I went on a search through Sharepoint Manager
to try to find those GUIDs
, but I can't find them. 因此,我通过
Sharepoint Manager
进行搜索以尝试找到那些GUIDs
,但是找不到它们。 Neither is the list ID
, nor the original View ID
, nor the web ID
or the site ID
. list ID
,原始View ID
, web ID
或site ID
都不是。
So my question: Does anybody know what these ID's
stand for, and how I can find them with my webpart
code? 所以我的问题是:是否有人知道这些
ID's
含义,以及如何通过我的webpart
代码找到它们?
Have you considered using XSLT to customize the output of the webpart? 您是否考虑过使用XSLT定制Webpart的输出? You could then customize the output HTML and include any identifiers you wish so that you could reference them in your javascript.
然后,您可以自定义输出HTML,并包含所需的任何标识符,以便可以在javascript中引用它们。 This is a pretty good description of how to do this: Overriding the presentation of an XSLT List View Web Part .
这是关于如何执行此操作的很好的描述: 覆盖XSLT列表视图Web部件的表示 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.