jQWidgets Forums

jQuery UI Widgets Forums Grid Multiple custom filters with prefilled text boxes

This topic contains 2 replies, has 3 voices, and was last updated by  KenFer 12 years, 1 month ago.

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

  • nikitaso
    Participant

    Is it possible to pre fill filter box with value?

    How tick a checkedlist filter?

    Whats the best way adding multipe filters?

    this is what i have right now:

                            var filtergroup = new $.jqx.filter();
                            var filtervalue = "MA";
                            var filtercondition = 'CONTAINS';
    
                            var filter1 = filtergroup.createfilter('stringfilter', filtervalue, filtercondition);
                            var filter_or_operator = 1;
                            filtergroup.addfilter(filter_or_operator, filter1);
    
    
                            
                            $("#jqxgrid").jqxGrid('addfilter', 'Source', filtergroup);
                            
                            //filter 2
                            var filtergroup2 = new $.jqx.filter();
                            var filtervalue2 = "DNT";
                            var filtercondition2 = 'EQUALS';
    
                            var filter2 = filtergroup2.createfilter('stringfilter', filtervalue2, filtercondition2);
                            var filter_or_operator2 = 1;
                            filtergroup.addfilter(filter_or_operator2, filter2);
    
                            $("#jqxgrid").jqxGrid('addfilter', 'Status', filtergroup2);
    
    
                            //filter 3
                            var filtergroup3 = new $.jqx.filter();
                            var filtervalue3 = "Timed Out";
                            var filtercondition3 = 'EQUALS';
    
                            var filter3 = filtergroup3.createfilter('stringfilter', filtervalue3, filtercondition3);
                            var filter_or_operator3 = 1;
                            filtergroup.addfilter(filter_or_operator3, filter3);
    
                            $("#jqxgrid").jqxGrid('addfilter', 'Status', filtergroup3);

    Peter Stoev
    Keymaster

    Hi nikitaso,

    The FilterRow is empty in the initialization. If you want to customize the filter widgets, you can use the createfilterwidget callback function. createfilterwidget is called when the filter widget is being initialized

    Example:

    $("#jqxgrid").jqxGrid(
    {
    width: 400,
    source: dataAdapter,
    showfilterrow: true,
    filterable: true,
    theme: theme,
    columns: [
    { text: 'Name', filtertype: 'list', filteritems: ['Lars Ohno', 'Nancy Davolio', 'Ian Peterson', 'Antoni Rossi', 'Regina Wilson'], datafield: 'name', width: 200 },
    { text: 'Product', datafield: 'productname',
    createfilterwidget: function (column, columnelement, widget) {
    setTimeout(function () {
    widget.val('hello');
    }, 1);
    }
    }
    ]
    });

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    KenFer
    Member

    Hi Peter,

    if I add “default values” to the filter using the above sample. I can’t figure out how to trigger the filterupdate.

    If I jump into one of the fields and tab out of it … $(“#grid”).jqxGrid (‘updatebounddata’); is called and the data is filtered.

    I tried using a button and assigning the $(“#grid”).jqxGrid (‘updatebounddata’); call to the click event… I can see that something is happening (because the wait animation is running) but the data is not updated..

    Any idea?

    Thanks

    Kenneth

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

You must be logged in to reply to this topic.