jQWidgets Forums

jQuery UI Widgets Forums Grid help with url binding

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • help with url binding #58846

    lev_povolotsky
    Participant

    Hi,

    I try to understand what is the best practise to define the server name at the URL that I have to access according to get the data from like her

                var testsSource =
                {
                    dataType: "json",
                    dataFields: [
                        { name: 'name', type: 'string' },
                        { name: 'country', type: 'string' },
                        { name: 'city', type: 'string' },
                        { name: 'street', type: 'string' },
                    ],
    
                    root: 'result',
                    url: host + "get/address",
                };

    how to do that url : host to be according to the dev environment or production environment?

    help with url binding #58847

    lev_povolotsky
    Participant

    what is the right solution to solve it because I each time change it manually and I’m sure it a bad practice

    help with url binding #58861

    Peter Stoev
    Keymaster

    Hi lev_povolotsky,

    The “url” parameter should point to a valid URL. The dataAdapter will make an Ajax call to it and if it returns data, it will be loaded in the dataAdapter. Otherwise, the dataAdapter’s loadError callback will be called if the client-server communication fails.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    help with url binding #58875

    lev_povolotsky
    Participant

    Yes everything that you told me is right.

    but I can I define the host server according the data layer dev environment or prod env do I have any way to do that?

    help with url binding #58877

    Peter Stoev
    Keymaster

    Hi lev_povolotsky,

    what url to use depends on your code. We don’t have properties for setting two different types of url.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.