How to expand/collapse the list item by title in the list view webpart

Hi,

I have a requirement as below:

I have a list view web part.  I want to add collapse/expand feature on the title of the each list item, so that, if I click on the title, I will see the list item contents of the corresponding title. Could you please suggest a approach using JavaScript/Jquery as we cannot do it using OOB?

Note: I already used two columns for grouping. So I cannot use Title column for grouping as sharepoint doesn't allow more than two columns for grouping. Also I cannot use sharepoint designer. JavaScript/Jquery/Calculated column is the only way.

T

May 29th, 2015 8:46am

Hi Manoj,

Per my understanding, you might want to implement more than two level grouping in the OOTB list view.

There seems no easy way to meet your requirement without using SharePoint Designer to modify the view in XSLT format:

http://techtrainingnotes.blogspot.com/2008/11/sharepoint-group-by-on-more-than-2.html

If you want to go in a way of using JavaScript, a thought is that you might need to modify the HTML source code of page element to implement the custom multiple level grouping in the current list view which already has two level grouping applied. For the data in the Third level grouping, JavaScript Client Object Model would be a good choice to access data of SharePoint list.

How to: Create, Update, and Delete List Items Using JavaScript

http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx    

Common Programming Tasks in the JavaScript Object Model

http://msdn.microsoft.com/en-us/library/office/hh185015(v=office.14).aspx  

About how to add JavaScript into SharePoint page via a Content Editor Web Part:

http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx

Thanks 

Patrick Liang

Free Windows Admin Tool Kit Click here and download it now
June 1st, 2015 2:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics