jQuery UI Widgets Forums Grid setting a filter with an URL

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • setting a filter with an URL #15407

    antonomase
    Participant

    Hi,

    I have a grid with two columns Name and Address

    $("#eta_jqxgrid").jqxGrid(
    { source: eta_dataAdapter,
    sortable: true,
    pageable: true,
    pagesize: 20,
    showfilterrow: true,
    filterable: true,
    columns: [
    {text: 'Name', datafield: 'NAME', filtertype: 'textbox', filtercondition: 'contains'},
    {text: 'Address', datafield: 'ADDRESS', filtertype: 'textbox', filtercondition: 'contains'}
    ]
    });

    I want to have URLs like mysite.com?NAME=abcd&ADDRESS=1234 which filters the results on these two fields

    I tried to put this after the reading of the rows in the database

    var filtervalue = 'abcd';
    var filtercondition = 'contains';
    var filter = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    filtergroup.addfilter(1, filter);
    $('#eta_jqxgrid').jqxGrid('addfilter', 'NAME', filtergroup);

    But this does nothing.

    Question 1 : why sometimes it must be filtertype = ‘textbox’ and sometimes filtertype = ‘stringfilter’ ?

    Question 2 : How to do for this filter to work ?

    Thanks for your answers

    setting a filter with an URL #15410

    Peter Stoev
    Keymaster

    Hi antonomase,

    The filtertype column property specifies the type of the filter widget in the filter row. The filter widget could be a textbox and that textbox could be used for entering the filter value for a “string”, “number”, “date” or a “boolean” column.

    To apply a filter through the API, see this sample: filtering.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.