OData Virtual Collection - Metadata

Posted by: chhavi.sethi on 12 April 2021, 2:34 am EST

  • Posted 12 April 2021, 2:34 am EST

    Hi,

    I have been using ODataVirtualCollectionView class.

    new ODataVirtualCollectionView('https://services.odata.org/V2/Northwind/Northwind.svc/Employees', '');
    

    In my case, I do not have a table to pass but an OData service full URL due to which the metadata service call is getting failed. Although the grid is working fine, it loads the data as expected. My question is can we skip that meta service call? If not why does ODataVirtualCollectionView need that?

    Thanks

  • Posted 12 April 2021, 5:27 pm EST

    Hi Chhavi,

    Can you share the URL of your OData service so we can check the issue? If you cannot share the URL publically, you can create a ticket on the new support portal:

    https://www.grapecity.com/my-account/my-support/

    Also, please make sure that the URL is accessible publically or at least to us.

    Regards,

    Ashwin

  • Posted 13 April 2021, 3:12 am EST

    Hi Ashwin,

    The service I am using is not hosted on any server, it is all local systems. However, as an example, you can use this “https://services.odata.org/V2/Northwind/Northwind.svc/Employees”.

    If I do it like the below snippet, It works because I have passed the table name(as a second parameter) to the virtual collection.

    
    new ODataVirtualCollectionView('https://services.odata.org/V2/Northwind/Northwind.svc', 'Employees');
    
    

    But, in my case, I don’t know what the table name is. Cause I am just getting a list of OData services from the database which I need to load on the Wijmo grid.

    
    new ODataVirtualCollectionView('https://services.odata.org/V2/Northwind/Northwind.svc/Employees', '');
    
    

    Thanks

  • Posted 13 April 2021, 3:36 pm EST

    Hi Chhavi,

    Thanks for the detailed information. I have replicated this issue and forwarded a bug report to the concerned team with internal tracking id WJM-19685. I will update you once I will hear from them.

    ~regards

  • Posted 19 April 2021, 12:05 am EST

    HI Chhavi,

    If your getting the URL of the collection directly, you can split the URL into service URL and the collection name:

    var url = 'https://services.odata.org/Northwind/Northwind.svc/Order_Details_Extendeds',
       svUrl = url.substring(0, url.lastIndexOf('/'));
       table = url.substring(url.lastIndexOf('/') + 1);
    
    new ODataVirtualCollectionView(svUrl, table);
    

    If this is not the structure of your URL, can you share a sample URL with us?

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels