ComponentOne Extender Controls for ASP.NET Web Forms
Wijmo Control Toolkit Extender Controls / C1DataSource / Reading Remote Data Using a Proxy
In This Topic
    Reading Remote Data Using a Proxy
    In This Topic

    You can use the following to read remote data using a proxy:

    // define a proxy

    var proxy = new wijhttpproxy({

                url: "http://ws.geonames.org/searchJSON",

                dataType: "jsonp",

                data: {

                    featureClass: "P",

                    style: "full",

                    maxRows: 12,

                    name_startsWith: 'ab'

                },

                key: 'geonames'

            });

    // define a reader

    var myReader = new wijarrayreader([

        {

            name: 'label',

            mapping: function (item){

                return item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName

            }

        },

        {name: 'value',mapping: 'name'}]);

    // create datasource

    var datasource = new wijdatasource({

        reader: myReader,

        proxy: proxy,

        loaded: function (data){

            // read items.

            var items = data.items;

        }

    });

    // trigger load.

    datasource.load();