jQWidgets Forums

jQuery UI Widgets Forums Grid Add bool filter

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Add bool filter #15339

    morfeusz
    Participant

    Hello,
    I’m trying to add boolean filter to my grid.
    In source I have checked column –

    { name: 'checked' }, // [true, false]

    This is working:

    $("#Grid").jqxGrid('clearfilters');
    var filter_or_operator = 1;
    var filtertype = 'stringfilter';
    var filtervalue = 'true';
    var filtercondition = 'equal';
    var filtergroup = new $.jqx.filter();
    var filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
    filtergroup.addfilter(filter_or_operator, filter);
    $("#Grid").jqxGrid('addfilter', 'checked', filtergroup);
    $("#Grid").jqxGrid('applyfilters');

    But is it best practice method? – var filtervalue = ‘true’; // this is string, not bool

    In documentary I don’t see filtertype ‘bool’ in addFilter method

    Add bool filter #15349

    Peter Stoev
    Keymaster

    Hi morfeusz,

    To add a boolean filter, you need to create a “booleanfilter”, not a “stringfilter”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Add bool filter #15363

    morfeusz
    Participant

    It works.
    thank you for help.

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

You must be logged in to reply to this topic.