Query is defined when DataManager request Data from Server in Offline Mode

Hello,

I have an issue that I don't quite understand. For the data to be collected from the server for the Grid data manager, I need to pass with it an authenticator as a header. Using the WebApiAdaptor works fine, but the disadvantage is that I don't have access to functionalities like (sort/filter/search / etc ..)  on the client-side.

So, as I searched, I found the grid / the adaptor has an offline mode. However, when I use it, the query/header that was supposed to be passed as well is "removed". In other words, I receive null in my back end.

And if I only remove the "attribute: offline" from the data manager, the query is passed over again.

I tried to init the query in OnInit, in the constructor, in the declaration sector. 

Nothing, I keep receiving an empty header.

hope to hear from you at the earliest.






Attachment: collecte_5c14b9b9.rar

4 Replies

AZ Adam Zaghouani February 16, 2022 09:24 PM UTC

I have just discovered that I could pass the query along with the DataManager initialization, however, as per the WebAPI adaptor rule, it requires data in a form of an "array of data" and "count". 

Based on that, and even though the discovery made the server return the data correctly, however, it's not displayed in the grid, and I get an error as so "TypeError: data manager.dataSource.JSON.slice is not a function"

I found this link that may or may not resolve my issue, but I don't understand what's more needed as I provided exactly that. [ Count and Resul ]

https://www.syncfusion.com/feedback/5537/grid-offline-mode-not-working-for-me

Below is how data returned just as It was instructed, and note, it works when it's not offline. Therefore what changed? 






AZ Adam Zaghouani February 16, 2022 09:50 PM UTC

Update: 

I solved the issue after doing another extensive research, as it turns out, WebApiAdaptor doesn't need the data under the "result and count" form when the mode is offline, it will require only the data in JSON.

However, I've noticed that the Group filter doesn't work anymore,

and it keeps showing the grid loading but nothing comes of it. 

Although, when I tested this functionality, worked perfectly fine when the data was local. 

How, do you suggest this may be solved?



RS Rajapandiyan Settu Syncfusion Team February 17, 2022 04:08 PM UTC

Hi Adam, 

Thanks for contacting Syncfusion support. 

Based on your requirement you want to send additional parameters to the server side and perform filtering, sorting, etc., at server with using WebApi Adaptor. We will prepare the sample and update the further details on or before Feb 22nd, 2022. 

We appreciate your patience until then. 

Regards, 
Rajapandiyan S 



SK Sujith Kumar Rajkumar Syncfusion Team February 23, 2022 07:56 AM UTC

Hi Adam, 
 
Thanks for your patience. 
 
We created a Grid with Web API adaptor offline enabled sample from our end but unfortunately were unable to reproduce the reported problem as the Grid actions were working properly. You can check the below ASP.NET Core with angular sample for reference, 
 
 
So please share us the following information to validate further on this, 
 
  • Share us a video demonstration of the reported problem.
  • Are any console errors thrown? If so please share it.
  • Share us the Grid code file.
  • Share us package.json and module file of your application.
  • Syncfusion package version used.
  • If possible share us a replication sample or try reproducing it in the above shared sample. It would be helpful to identify your exact problem case and validate further based on that.
 
Regards, 
Sujith R 


Loader.
Up arrow icon