jQuery UI Widgets Forums Grid Grid Filter

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Grid Filter Posts
  • Grid Filter #61759

    joaompc
    Participant

    Hello

    I have a grid with a column OccurrenceID.

    I am using this to filter by a specfici OccurrenceID:

    function FilterGird (value, condition) {
            var filtergroup = new $.jqx.filter();
            var filtervalue = value;
            var filtercondition = condition;
            
            var filter_or_operator = 1;
            
            var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
    
            filtergroup.addfilter(filter_or_operator, filter1);
    
            $('#OccurrencesGrid').jqxGrid('addfilter', 'OccurrenceID', filtergroup);
            $("#OccurrencesGrid").jqxGrid('sortby', 'OccurrenceID', 'desc');
            $('#OccurrencesGrid').jqxGrid('applyfilters');
    }
    

    Then I use:

    FilterGird(2, 'EQUAL');

    To filter by OccurrenceID = 2.

    But I need to filter by several OccurrenceID, for example: 2, 4, 6, 10

    How can I do this? Can I pass an array into the filter?

    Thank you

    Grid Filter #61806

    Dimitar
    Participant

    Hello joaompc,

    You can apply a filter by multiple values (as shown in the demo Filtering) but you would have to modify your function to be able to pass multiple parameters or an array of values to it.

    Best Regards,
    Dimitar

    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.