Hi I am trying to use our rest api as data source of tree grid.But there is no clear documentation how to call a post request with request body in Data manager. Below is my approach. Please suggest a solution--
this.data = new DataManager({
url: 'https://api.****.com/fetchtree',
adaptor: new UrlAdaptor(),
headers: [{ 'Authorization': 'Bearer +token }]
});
this.query = new Query()
.addParams('userId', '1')
.addParams('entityId', '2')
and in Template -
<ejs-treegrid [dataSource]='data' [treeColumnIndex]='1' [query]='query' parentIdMapping='ParentItem' idMapping='TaskID' height=265 [allowPaging]="true">
<e-columns>
<e-column field='TaskID' headerText='Task ID' width='90' textAlign='Right'></e-column>
<e-column field='TaskName' headerText='Task Name' width='170'></e-column>
<e-column field='StartDate' headerText='Start Date' width='130' format="yMd" textAlign='Right'></e-column>
<e-column field='Duration' headerText='Duration' width='80' textAlign='Right'></e-column>
</e-columns>
</ejs-treegrid>`