jQWidgets Forums

jQuery UI Widgets Forums Grid remove Filter in gird

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • remove Filter in gird #57277

    ssp
    Participant

    Hi,

    I have enabled filters for grid column and it is working fine.
    Is the anyway to get the datafield name on which we clearing the filter, on filter event.

    NOTE : ‘getfilterinformation’ will get information of column which has value. Not if we remove the entered text.

    here is the snippet :

    $(“#jqxgrid”) .on(
    “filter”,
    function(event) {
    var filterGroups = $(‘#jqxgrid’)
    .jqxGrid(
    ‘getfilterinformation’);
    var info = “”;
    for (var i = 0; i < filterGroups.length; i++) {
    var filterGroup = filterGroups[i];
    var filters = filterGroup.filter.getfilters();
    for (var j = 0; j < filters.length; j++) {
    dataFieldName = filterGroup.filtercolumn;
    setCookie(dataFieldName,
    filters[j].value, 1);

    }
    }

    });

    remove Filter in gird #57282

    Peter Stoev
    Keymaster

    Hi ssp,

    As far as I know, to clear a filter you have to pass the dataFieldName. Also in your code, it seems that you know how to get the datafield’s name or at least, it seems like that from this code: dataFieldName = filterGroup.filtercolumn

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    remove Filter in gird #57291

    ssp
    Participant

    Hi Peter,

    filterGroups will come as empty array if we clear the filter text. So i am not able get the datafield name for which i cleared the filter text.

    Regards,
    SSP

    remove Filter in gird #57295

    Peter Stoev
    Keymaster

    Hi ssp,

    If it is empty array, then you don’t have applied filter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.