jQuery UI Widgets Forums Grid How to get filtering url with data?

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • How to get filtering url with data? #82246

    Huseyn
    Participant

    How to get filtering url with data?

    How to get filtering url with data? #82249

    Dimitar
    Participant

    Hello Huseyn,

    Please clarify your requirement. Where in your code do you wish to get the URL? Do you mean getting the filtering settings and processing them on the server side? If so, we have a server-side filtering help topic you can find here: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-grid-filtering.htm.

    Best Regards,
    Dimitar

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

    How to get filtering url with data? #82255

    Huseyn
    Participant

    i want to alert url with filtering, sorting and paging parameteres when this events happen,

    var url=’employeesfiltering.jsp’;
    var source = {
    datatype: “json”,
    datafields: [{
    name: ‘e_id’,
    type: ‘int’
    }, {
    name: ‘e_name’,
    type: ‘string’
    }, {
    name: ‘e_surname’,
    type: ‘string’
    }, {
    name: ‘e_birth’,
    type: ‘date’
    }],
    cache: false,
    url: url,
    filter: function() {
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘filter’);
    },
    sort: function() {
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘sort’);
    },
    beforeprocessing: function(data) {
    if (data !== null && data.length > 0) {
    source.totalrecords = data[0].totalRecords;
    }
    }

    };
    var dataadapter = new $.jqx.dataAdapter(source, {

    downloadComplete: function(data, status, xhr) {
    if (!source.totalRecords) {
    source.totalRecords = data.length;
    }
    },
    loadError: function(xhr, status, error) {
    throw new Error(error);
    }
    });
    // initialize jqxGrid
    $(“#jqxgrid”).jqxGrid({
    width: 550,
    source: dataadapter,
    filterable: true,
    showfilterrow: true,
    sortable: true,
    autoheight: true,
    pageable: true,
    pagesize: 5,
    pagesizeoptions: [‘3’, ‘5’, ‘7’],
    virtualmode: true,
    rendergridrows: function(obj) {
    return obj.data;
    },
    columns: [{
    text: ‘e_id’,
    datafield: ‘e_id’

    }, {
    text: ‘e_name’,
    datafield: ‘e_name’
    }, {
    text: ‘e_surname’,
    datafield: ‘e_surname’
    }, {
    text: ‘e_birth’,
    datafield: ‘e_birth’,
    cellsformat: ‘dd.MM.yyyy’,
    align: ‘right’,
    cellsalign: ‘right’ ,
    filtertype: ‘range’
    }]
    });

    });

    • This reply was modified 4 years ago by  Huseyn.
    How to get filtering url with data? #82271

    Huseyn
    Participant

    Wants like this:
    employeesfiltering.jsp?e_nameoperator=and&filtervalue0=a&filtercondition0=CONTAINS&filteroperator0=1&filterdatafield0=e_name&e_surnameoperator=and&filtervalue1=a&filtercondition1=CONTAINS&filteroperator1=1&filterdatafield1=e_surname&e_idoperator=and&filtervalue2=1&filtercondition2=EQUAL&filteroperator2=1&filterdatafield2=e_id&filterscount=3&groupscount=0&sortdatafield=e_surname&sortorder=asc&pagenum=0&pagesize=5&recordstartindex=0&recordendindex=5&_=1457527867609

    • This reply was modified 4 years ago by  Huseyn.
    How to get filtering url with data? #82315

    Dimitar
    Participant

    Hi Huseyn,

    You can get this information in the data adapter beforeSend callback function as follows:

    var dataadapter = new $.jqx.dataAdapter(source, {
        downloadComplete: function(data, status, xhr) {
            if (!source.totalRecords) {
                source.totalRecords = data.length;
            }
        },
        loadError: function(xhr, status, error) {
            throw new Error(error);
        },
        beforeSend(jqXHR, settings) {
            alert(settings.url);
        }
    });

    Best Regards,
    Dimitar

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

    How to get filtering url with data? #95616

    cstff
    Participant

    How can I get the same information when the filter is not remote?

    How to get filtering url with data? #95620

    Dimitar
    Participant

    Hello cstff,

    The method getfilterinformation returns information about the applied filters. You can read more about it in the jqxGrid API documentation.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.