This is a migrated thread and some comments may be shown as answers.

oData WebGet

0 Answers 100 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 13 Jun 2012, 04:22 PM
I am trying to fill a Kendo Mobile ListView with data retrieved from a WCF Data Service WebGet with no luck.  Is there something I am missing.  

WCF Method:

        [WebGet]
        public IQueryable<AttributeType> GetRanges()
        {
            var ranges = (from pa in this.CurrentDataSource.ProductAttributes
                          where pa.oDataAttTypeDesc == "Range"
                          select new AttributeType() { Name = pa.oDataAttValue }).Distinct().OrderBy(a => a);
            return ranges;
        }

Hitting the URL gives:


<?
xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <GetRanges xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
- <element p2:type="ODataSearch.AttributeType"xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<Name>All Manufacturers</Name>
</element>
- <element p2:type="ODataSearch.AttributeType"xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<Name>Aqualisa</Name>
</element>
- <element p2:type="ODataSearch.AttributeType" xmlns:p2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<Name>Bristan</Name>
</element>
</GetRanges> 

DataSource is setup as follows:

DataSources._Ranges = new kendo.data.DataSource({
        type: "odata",
        transport: {
            read: {
                url: "http://localhost:54948/ProductDataService.svc/GetRanges"
            }
        }
    });

and the html page sets the control as follows:

            $("#range-listview").kendoMobileListView({
                dataSource: kendo.data.DataSource.create({ data: DataSources._Ranges }),
                template: "${Name}"
            });


No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Alan
Top achievements
Rank 1
Share this question
or