We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to map data from DataManager using UrlAdpator in ListView

From the document, UrlAdaptor is required to process data from DataManager that sends requests to server-side. I replicated my intent in attachment. To summarize, I am using Listview. The dataSource is DataManager() object that query from server. As explained from document, an UrlAdaptor is needed to map return data.

The Server Side controller is:


I followed this:

I tried the way it was suggest, but my ListView could not map response data. However, it could not map the view.


Also, I wonder that whether I could add extra helpful information from server-side response for debugging purpose.
Such as:



How do I parse out those extra properties from JSON object. So I could render it into my page.

Thanks,
Peng

Attachment: Razorpages461008119_55049a5d.zip

1 Reply

VK Vinoth Kumar Sundara Moorthy Syncfusion Team August 7, 2019 01:49 AM

Hi Peng, 
 
Good day to you. 
 
We have checked your query and prepared a sample with data with format mentioned in documentation. We use the query property for getting data from server. In query property we have used requiresCount method to parse result data from server and applied to ListView component. 
 
The query should be used as like in the below code snippet, 
query: new ej.data.Query().requiresCount() 
 
Sample Data format 
{ 
    "result": [{ 
        "Name": "sample1", 
        "Id": "Id1" 
    }, { 
        "Name": "sample2", 
        "Id": "Id2" 
    }, { 
        "Name": "sample3", 
        "Id": "Id3" 
    }, { 
        "Name": "sample4", 
        "Id": "Id4" 
    }], 
        "count": "2", 
        "message": "Success", 
    "Status":"Success" 
} 
 
 
We have prepared a sample for required sample data (contains result and count) and the same can be downloaded from below link, 
 
 
Could you please check the above sample and get back to us if you need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon