Skip to content

Add React Content Query Programmatically to a ClientSidePage #19

@anisiaalexandra

Description

@anisiaalexandra

Hi,

I ave been trying to add the react content query to a ClientSidePage programmatically by setting the JSONProperty in the following way:
CQWebPart.PropertiesJson =
JObject.FromObject(new
{
description = "Content Query",
enableMGT = true,
itemSelectorEnabled = false,
idFieldForciblyAdded = false,
webUrl = "https://tenant.sharepoint.com/sites/Dev100053/",
siteUrl = "https://tenant.sharepoint.com/sites/Dev100053/",
listId = "NonCompliancyRegister",
viewFields = "",
externalScripts = "https://tenant.sharepoint.com/sites/Dev100053/SiteAssets/ICTSolNonCompliancyIssuesHandleBarCQ.js",
templateUrl = "https://tenant.sharepoint.com/sites/Dev100053/SiteAssets/ICTSolNonCompliancyIssuesHandleBarCQ.html",
hasDefaultTemplateBeenUpdated = true
}).ToString();
But unfortunatelly nothing is set.
What os the correct way to programmatically configure this web part?
Thank you in advance for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions