jQWidgets Forums

jQuery UI Widgets Forums Grid Grid source question passing prams

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Grid source question passing prams #26893

    DavidSimmons
    Participant

    I need to pass some parameters to the url as a part of the source call. Looking at your examples shown below
    can I pass using something like this? I would appreciate your help…
    ************
    processdata: function (data) {
    data.ID = ’19’;
    }
    ************

    var source =
    {
    datatype: “jsonp”,
    datafields: [
    { name: ‘countryName’ },
    { name: ‘name’ },
    { name: ‘population’, type: ‘float’ },
    { name: ‘continentCode’ }
    ],
    url: “http://ws.geonames.org/searchJSON”,
    processdata: function (data) {
    data.featureClass = “P”;;
    data.style = “full”;
    data.maxRows = 50;
    }
    };

    Grid source question passing prams #26896

    Peter Stoev
    Keymaster

    Hi David,

    This help topic illustrates how to pass additional parameters: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Grid source question passing prams #26905

    DavidSimmons
    Participant

    Ok that works great…
    data: {
    ID: “12”
    }

    But now I have to do a $(jqxgrid).jqxGrid(‘updatebounddata’); after an update and grid returns with no data found.
    If I refresh the page the data is correct with updates as well.

    Does the updatebounddata not use the data object. If not how can pass the data object within the updatebounddata?

    I Have tried the following but does not work.

    $(jqxgrid).jqxGrid(‘updatebounddata’, data);

    and

    $(jqxgrid).jqxGrid(‘updatebounddata’ source.data);

    Grid source question passing prams #26906

    Peter Stoev
    Keymaster

    Hi David,

    data: {
    ID: “12″
    }

    is a definition of one time object initialization and “updatebounddata” will send that data each time you call the method. The “formatData” callback is more appropriate in scenarios where you have to dynamically make updates and send updated parameters.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.