jQuery UI Widgets Forums Grid Source Adapter Data bug

This topic contains 6 replies, has 2 voices, and was last updated by  Benji6996 7 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Source Adapter Data bug #20777

    Benji6996
    Participant

    I may be wrong but I am pretty sure there is a bug in the ‘dataadapter’ source.data option. Whilst it took me a long time to find, the documentation states that you can supply an object like so:

    var source = {
    url: '//www.example.com/test.php',
    data: {'reference':'test'}
    };

    However, none of the object properties are passed to the server… It works if I use an array, but then I don’t get ‘reference’=>’test’, I get 0=>’test’.

    Apologies if I am not using it correctly but i assumed it would act the same as the jQuery Ajax data property…

    If it helps, I am using version 2.5.5

    Thanks in Advance

    Source Adapter Data bug #20780

    Peter Stoev
    Keymaster

    Hi Benji6996,

    The documentation available on our website is for jQWidgets 2.8.3. If you have an issue, then please make sure that it is present in jQWidgets 2.8.3, too.

    Best Regards,
    Peter Stoev

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

    Source Adapter Data bug #20787

    Benji6996
    Participant

    All updated, now running version 2.8.3 and I am still having trouble sending the parameters with the data property. I assume it is sent as a GET variable?

    Source Adapter Data bug #20788

    Peter Stoev
    Keymaster

    Hi,

    1. You may take a look at this help topic: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm.

    2. Yes, the params are sent as GET by default if POST is not explicitly set.

    Best Regards,
    Peter Stoev

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

    Source Adapter Data bug #20789

    Benji6996
    Participant

    I am doing exactly what it states in the example, as shown here:

    var source = {
    url: '//www.example.net/test.php',
    datatype: "json",
    datafields: data.datafields,
    data: {reference:'test'},
    root: 'items',
    cache: false,
    filter: function(){
    // Update the grid and send a request to the server.
    $("#mfs_grid").jqxGrid('updatebounddata', 'filter');
    },
    sort: function(){
    // Update the grid and send a request to the server.
    $("#mfs_grid").jqxGrid('updatebounddata', 'sort');
    },
    beforeprocessing: function(data){
    if(data != null){
    // Update the total records
    // THIS NEEDS UPDATING
    //source.totalrecords = data[0].TotalRows;
    }
    }
    };

    I am sure I could get it to work using the format data property, but just want to make sure I am not doing anything wrong…

    Source Adapter Data bug #20791

    Peter Stoev
    Keymaster

    Hi,

    Unfortunately, I do not know what is the issue on your side. The “data” field of the source object works as expected with the current version and we also have online sample as a proof here: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/bindingtojsonp.htm?web. We send 3 custom parameters to a remote server and depending on the parameter values, it returns data that is displayed in the Grid.

    Best Regards,
    Peter Stoev

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

    Source Adapter Data bug #20794

    Benji6996
    Participant

    Thanks for your help, I have managed to sort it after some extensive debugging in my code.

    Thanks again 🙂

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

You must be logged in to reply to this topic.