jQuery UI Widgets Forums Grid Post data with Grid source?

This topic contains 2 replies, has 2 voices, and was last updated by  Dimitar 11 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Post data with Grid source? #29628

    realtek
    Participant

    Hi,

    I have a source with a JSON datatype for my Grid which its bound to.

    How can I also send some ‘data’ with it, so I basically want to do some filtering on the server side.

    So the source would have something like data : { filter : ‘test’ }

    I can then get this filter using something like $_POST[“filter”].

    I have tried using the example above but it does not seem to send the data with the source request.

    Thanks

    Post data with Grid source? #29629

    realtek
    Participant

    Here is my code:

    var url = "json/mainGrid.php"
    var source = {
    datatype: 'json',
    url: url,
    id: "SEQUENCE",
    root: 'rowsinfo',
    cache: false,
    columns:[],
    beforeprocessing: function (data) {
    var columnsdata = new Array();
    for (k in data.columnsinfo){
    var col={};
    col.text = data.columnsinfo[k]["DISPLAYNAME"];
    col.datafield = data.columnsinfo[k]["DISPLAYNAME"];
    columnsdata.push(col);
    source.columns = columnsdata;
    }
    $("#jqxgrid").jqxGrid({columns : source.columns});
    },
    data: {
    startcolumn: 1,
    filter: '1'},
    };
    Post data with Grid source? #29663

    Dimitar
    Participant

    Hello realtek,

    One of the tutorials Server Side Filtering with jqxGrid using PHP and MySQL and jqxGrid Server Filtering (ASP.NET MVC3) might be helpful to you. Please check them out.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.