jQWidgets Forums

jQuery UI Widgets Forums Grid Clear grid filter

This topic contains 8 replies, has 3 voices, and was last updated by  nikesh_ap 6 years, 6 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Clear grid filter #46251

    nikitaso
    Participant

    $(‘#jqxgrid’).jqxGrid(‘removefilter’, “Price”, true);

    It clears that particular filter, refreshes the grid but does not remove value from textbox (filterrow).

    Any ideas?

    Thank you!
    Nick.

    Clear grid filter #46256

    Peter Stoev
    Keymaster

    Hi Nick,

    Have you tried calling “refreshfilterrow” after you removed a filter?

    Best Regards,
    Peter Stoev

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

    Clear grid filter #46293

    nikitaso
    Participant

    Here taken from filter sample:

        <script type="text/javascript">
            $(document).ready(function () {
                var theme = getDemoTheme();
    
                var data = generatedata(500);
                var source =
                {
                    localdata: data,
                    datafields:
                    [
                        { name: 'name', type: 'string' },
                        { name: 'productname', type: 'string' },
                        { name: 'available', type: 'bool' },
                        { name: 'date', type: 'date' },
                        { name: 'quantity', type: 'number' }
                    ],
                    datatype: "array"
                };
    
                var dataAdapter = new $.jqx.dataAdapter(source);
    
                $("#jqxgrid").jqxGrid(
                {
                    width: 685,
                    source: dataAdapter,
                    showfilterrow: true,
                    filterable: true,
                    theme: theme,
                    selectionmode: 'multiplecellsextended',
                    columns: [
                      { text: 'Name', columntype: 'textbox', filtertype: 'textbox', filtercondition: 'starts_with', datafield: 'name', width: 115 },
                      {
                          text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220
                      },
                      { text: 'Available', datafield: 'available', columntype: 'checkbox', filtertype: 'bool', width: 67 },
                      { text: 'Ship Date', datafield: 'date', filtertype: 'date', width: 210, cellsalign: 'right', cellsformat: 'd' },
                      { text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' }
                    ]
                });
                $('#clearfilteringbutton').jqxButton({ height: 25, theme: theme });
                $('#clearfilteringbutton').click(function () {
                    $('#jqxgrid').jqxGrid('removefilter', "name", true);
                   
                });
            });
        </script>
    
    Clear grid filter #46295

    nikitaso
    Participant

    ‘refreshfilterrow’ not working.

    Clear grid filter #46296

    Peter Stoev
    Keymaster

    Hi nikitaso,

    Sorry, but I do not see anywhere in the code a “refreshfilterrow” call. Which version do you use? Also to clear the filter row values, there’s also a method called “clearfilterrow”

    Best Regards,
    Peter Stoev

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

    Clear grid filter #46300

    nikitaso
    Participant

    I basically need to remove only one filter, lets say I applied 2 filters and I want to remove one of them using api.

    http://bondsdemo.trademorebonds.com/grid-filter.html

    Enter ‘an’ to ‘name’ col and 5 into ‘qty’ column, then ‘remove filter’. it removes ‘name’ filter and clears value from ‘qty’

    http://localhost:1677/grid-filterrefresh.html << with ‘refresh’

    Clear grid filter #46308

    Peter Stoev
    Keymaster

    Hi nikitaso,

    “clearfilterrow” will clear the values in the filter row – that’s the method’s purpose.
    “refreshfilterrow” will update the values in the filter row, if a column has applied filter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Clear grid filter #46310

    nikitaso
    Participant

    So there is no way to clear one filter and leave others active?

    Clear grid filter #102958

    nikesh_ap
    Participant

    Hi Peter,

    Is there any way we can add a clear control to individual columns inside the filter TextBox?

    Thanks,
    Nikesh.

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

You must be logged in to reply to this topic.