Home > CMS- Content Management System > Sharepoint > How load list item with individual column filtration in office 365/ SharePoint 2013 page?

How load list item with individual column filtration in office 365/ SharePoint 2013 page?

This post was most recently updated on August 2nd, 2024

Below I share code to apply filter option to SharePoint list using the jquery data table. 

Steps: Page level

  • Create page and add following datatable css and js.<link rel=”stylesheet” type=”text/css” href=”https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css” />
    <script src=”https://code.jquery.com/jquery-1.12.4.js” type=”text/javascript”></script>
    <script type=”text/javascript” src=”https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js”></script>
  • Create table with header according to SharePoint list. <div class=”Filters”><div><span>ID FIlter</span><span class=”idFilterOption”></span> <span>Adjustment Type FIlter</span><span class=”requestFilterOption”></span></div></div>

    <table id=”table_id” class=”display” role=”grid” width=”100%” cellspacing=”0″>
    <thead>
    <tr>
    <th>ID</th>
    <th>Title</th>
    <th>Adjustment Type</th>
    <th>Adjustment Requested</th>
    <th>Unique No</th>
    </tr>
    </thead>
    </table>

Steps: JS Level


  • Step 1: We need to get item count of threshold exceed list/normal SharePoint list by GetItemCount () function.

  • Step 2: Next step create rest service url by splitting rest call according to item count of GetItemCount () function. Check item count if item count is above 5000 then we split calling with 1000 item per call top=1000 for better performance. Otherwise we call as usual i.e. top=5000.//Step 2. create rest service url if item count is above 5000 then we split calling with 1000 item per call top=1000 for better performance. Otherwise we call as usual 5000 items top=5000
  • Step 3: Process each item of threshold list by repeatedly calling getJSONDataFromUrl () function. GetJSONDataFromUrl () function gives Ajax json object. //Step 3: Rest call to procerss each items of list

Final Screen shot without filtration

Screen Shot with filter

Reference:

https://sharepoint.stackexchange.com/questions/217254/rest-to-read-more-than-5000-items-from-document-library/217451#217451

 

This Article is TAGGED in . BOOKMARK THE permalink.

2 thoughts on “How load list item with individual column filtration in office 365/ SharePoint 2013 page?

Leave a Reply to yilmaz teksin Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">