Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit e645058

Browse files
Merge pull request #588 from patrick-rodgers/dev
adding support for list.RenderListDataAsStream
2 parents 4f46949 + 510d579 commit e645058

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/sharepoint/lists.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCo
88
import { SharePointQueryableSecurable } from "./sharepointqueryablesecurable";
99
import { Util } from "../utils/util";
1010
import { TypedHash } from "../collections/collections";
11-
import { ControlMode, RenderListData, ChangeQuery, CamlQuery, ChangeLogitemQuery, ListFormData } from "./types";
11+
import { ControlMode, RenderListData, ChangeQuery, CamlQuery, ChangeLogitemQuery, ListFormData, RenderListDataParameters } from "./types";
1212
import { UserCustomActions } from "./usercustomactions";
1313
import { spExtractODataId } from "./odata";
1414
import { NotSupportedInBatchException } from "../utils/exceptions";
@@ -379,6 +379,28 @@ export class List extends SharePointQueryableSecurable {
379379
});
380380
}
381381

382+
/**
383+
* Returns the data for the specified query view
384+
*
385+
* @param parameters The parameters to be used to render list data as JSON string.
386+
* @param overrideParameters The parameters that are used to override and extend the regular SPRenderListDataParameters.
387+
*/
388+
public renderListDataAsStream(parameters: RenderListDataParameters, overrideParameters: any = null): Promise<any> {
389+
390+
const postBody = {
391+
overrideParameters: Util.extend({
392+
"__metadata": { "type": "SP.RenderListDataOverrideParameters" },
393+
}, overrideParameters),
394+
parameters: Util.extend({
395+
"__metadata": { "type": "SP.RenderListDataParameters" },
396+
}, parameters),
397+
};
398+
399+
return this.clone(List, "RenderListDataAsStream", true).postCore({
400+
body: JSON.stringify(postBody),
401+
});
402+
}
403+
382404
/**
383405
* Gets the field values and field schema attributes for a list item.
384406
*/

src/sharepoint/types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,3 +1388,18 @@ export interface WikiPageCreationInformation {
13881388
*/
13891389
WikiHtmlContent: string;
13901390
}
1391+
1392+
export enum RenderListDataOptions {
1393+
None = 0,
1394+
ContextInfo = 1,
1395+
ListData = 2,
1396+
ListSchema = 4,
1397+
MenuView = 8,
1398+
}
1399+
1400+
export interface RenderListDataParameters {
1401+
ViewXml?: string;
1402+
Paging?: string;
1403+
FolderServerRelativeUrl?: string;
1404+
RenderOptions?: RenderListDataOptions;
1405+
}

0 commit comments

Comments
 (0)