query where predicates are null at server side when datamanager initialized

Hi,

when dataManger initialized below at client side( angular)  the server side  DataManagerRequest  where property is null.

we are getting where predicates server side when we use dm.executeQuery()

but i want  where query at server side when we initialize datamanager not when  executeQuery

client side

   const predicate: Predicate = new Predicate('iso', 'equal', '12_12').or('iso', 'equal', '');
    const query = new Query().where(predicate);
    this.jointDataManager = new DataManager({
      url: `${this.configService.base_url}${jointApiBaseUrl}${viewId}/kind/${kind}/master/${master}`,
      headers: [{ Authorization: 'Bearer ' + this.authService.getIdToken() }],
      adaptor: new CustomAdaptor
    }, query);


server side

   public async Task<JObject> GetPagedArtefactsByViewIdAsync(string viewId, string kind, bool master, DataManagerRequest dataManagerRequest)

        {

            try

            {

}}


Thanks,

Dayakar


1 Reply

RS Rajapandiyan Settu Syncfusion Team January 28, 2022 11:00 AM UTC

Hi Dayakar, 

Thanks for contacting Syncfusion support. 

If you are using dataManager as the dataSource of Grid, you can achieve your requirement by using grid.query property. 



[app.component.html] 

    <ejs-grid #grid [dataSource]='data' [query]="query" allowPaging='true' [pageSettings]='pageSettings'> 
        --- 
    </ejs-grid> 

[app.component.ts] 

  ngOnInit(): void { 
    this.query = new Query().where(this.predicate); 
    this.data = new DataManager({ 
      url: `${this.configService.base_url}${jointApiBaseUrl}${viewId}/kind/${kind}/master/${master}`, 
      headers: [{ Authorization: 'Bearer ' + this.authService.getIdToken() }], 
      adaptor: new CustomAdaptor(), 
    }); 
  } 


Note: If you are using DataManager without Grid component or any other Syncfusion component, then you need to manually call the executeQuery method to post the request to the server. 


Regards, 
Rajapandiyan S 


Loader.
Up arrow icon