简体   繁体   中英

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?

I am working on adding some additional behaviour to a standard sharepoint listview-webpart .

Preferably I don't want to actually edit the webpart itself. 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.

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_ .

A bit further down in the hierarchy is the main table of the view, and it also has an ID . In my test-case: {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.

So I went on a search through Sharepoint Manager to try to find those GUIDs , but I can't find them. Neither is the list ID , nor the original View ID , nor the web ID or the site ID .

So my question: Does anybody know what these ID's stand for, and how I can find them with my webpart code?

Have you considered using XSLT to customize the output of the webpart? You could then customize the output HTML and include any identifiers you wish so that you could reference them in your javascript. This is a pretty good description of how to do this: Overriding the presentation of an XSLT List View Web Part .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM