Skip to content

Instantly share code, notes, and snippets.

@maxali
Last active May 19, 2016 20:26
Show Gist options
  • Save maxali/ae8af21aa0cbfdc55d58a7b510df1b38 to your computer and use it in GitHub Desktop.
Save maxali/ae8af21aa0cbfdc55d58a7b510df1b38 to your computer and use it in GitHub Desktop.
New SharePoint Document REST
TemplateHub.rest.post({
url:"https://inmetademo-9e1505ae3276fd.sharepoint.com/sites/templatehub/TemplateHub/_api/SP.AppContextSite(@target)/web/GetList(@listUrl)/RenderListDataAsStream?@listUrl='/sites/contentTypeHub/templatehub/Template Library'&@target='https://inmetademo.sharepoint.com/sites/contenttypehub/templatehub'&View=9dcf7a8c-e8f6-4866-8984-2465254ebb5f&FilterField1=Editor&FilterValue1=Mohamed Ali Abdi&FilterField2=FSObjType&FilterValue2=0",
data:'{"parameters":{"__metadata":{"type":"SP.RenderListDataParameters"},"ViewXml":"<View><Query><RowLimit>4</RowLimit></Query></View>","RenderOptions":23,"Paging":"","AllowMultipleValueFilterForTaxonomyFields":true}}'
})
.then(
function(data){
console.log(data)
})
/*
Not works with Note, Attachments and Computed type fields except DocIcon, PermMask,
**/
TemplateHub.rest.post({
url:"https://inmetademo-9e1505ae3276fd.sharepoint.com/sites/templatehub/TemplateHub/_api/SP.AppContextSite(@target)/web/GetList(@listUrl)/RenderListFilterData?@listUrl='/sites/contentTypeHub/templatehub/Template Library'&@target='https://inmetademo.sharepoint.com/sites/contenttypehub/templatehub'&FieldInternalName=Editor"
})
.then(
function(data) {
console.log(data)
})
***html
<SELECT id="diidFilterEditor"
TITLE="Filter by Modified By"
OnChange='FilterField("{9DCF7A8C-E8F6-4866-8984-2465254EBB5F}","Editor",this.options[this.selectedIndex].value, this.selectedIndex);'
dir=""
>
<OPTION SELECTED Value="">(All)</OPTION>
<OPTION Value="Mohamed Ali Abdi" >Mohamed Ali Abdi</OPTION>
</SELECT>
<br><img altbase="Presence enabled for this column" src="/_layouts/15/images/blank.gif?rev=43" onload="IMNRegisterHeader(event)" id="imnhdr0"/><a id="diidSortEditor" onfocus="OnFocusFilter(this)" class="ms-headerSortTitleLink" title="Sort by Modified By" href="javascript:" onclick="javascript:return OnClickFilter(this,event);" SortingFields="SortField=Editor&amp;SortDir=Asc&amp;View=%7b9DCF7A8C%2dE8F6%2d4866%2d8984%2d2465254EBB5F%7d">Modified By<img src="/_layouts/15/images/blank.gif?rev=43" class="ms-hidden" border="0" width="1" height="1" alt="Use SHIFT+ENTER to open the menu (new window)."/></a><img src="/_layouts/images/blank.gif" alt="" data-accessibility-nocheck="true" border="0"/><img src="/_layouts/images/blank.gif" border="0" alt="" data-accessibility-nocheck="true"/>
<!-- ----------------------------->
<SELECT id="diidFilterCreated"
TITLE="Filter by Created"
OnChange='FilterField("{9DCF7A8C-E8F6-4866-8984-2465254EBB5F}","Created",this.options[this.selectedIndex].value, this.selectedIndex);'
dir="">
<OPTION Value="">(All)</OPTION>
<OPTION Value="2016-05-13" >5/13/2016</OPTION>
<OPTION Value="2016-05-19" >5/19/2016</OPTION>
</SELECT>
<br><a id="diidSortCreated" onfocus="OnFocusFilter(this)" class="ms-headerSortTitleLink" title="Sort by Created" href="javascript:" onclick="javascript:return OnClickFilter(this,event);" SortingFields="SortField=Created&amp;SortDir=Asc&amp;View=%7b9DCF7A8C%2dE8F6%2d4866%2d8984%2d2465254EBB5F%7d">Created<img src="/_layouts/15/images/blank.gif?rev=43" class="ms-hidden" border="0" width="1" height="1" alt="Use SHIFT+ENTER to open the menu (new window)."/></a><img src="/_layouts/images/blank.gif" alt="" data-accessibility-nocheck="true" border="0"/><img src="/_layouts/images/blank.gif" border="0" alt="" data-accessibility-nocheck="true"/>
***html
https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.renderlistdataparameters.paging.aspx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment