jQWidgets Forums

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #77382

    neha
    Participant

    Thanks for the reply Dimitar.

    in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #77328

    neha
    Participant

    And, if i reset all the column’s filter items. Javascript error is thrown:-

    Uncaught RangeError: Maximum call stack size exceeded

    in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #77327

    neha
    Participant

    Also, if i used this code for last column (which filter has cleared):-
    if(filterGroup == undefined){

    $(‘#grid’).jqxGrid(‘removefilter’, filter_column, true);
    rows = $(‘#grid’).jqxGrid(‘getrows’);

    var items = [];

    for(var i = 0; i < rows.length; i++)
    {
    var row = rows[i];
    var dataFieldName = filter_column;
    if(items != null){
    var flag=1;
    for(var m = 0; m < items.length; m++)
    {
    if(items[m] == row[dataFieldName]){ flag=0; break;}
    }
    }
    if(flag == 1){
    items.push(row[dataFieldName]);
    }
    }

    $(“#grid”).jqxGrid(‘setcolumnproperty’, filter_column, ‘filteritems’, items);

    }

    The other columns, on which filter has not applied , filter items are not reset properly for them.

    Thanks,
    Neha

    in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #77316

    neha
    Participant

    Hi,

    In the cascade filtering, i have done the following code:-

    $(“#grid”).on(‘filter’, function (){
    var filterGroups = $(“#grid”).jqxGrid(‘getfilterinformation’);
    var rows = $(‘#grid’).jqxGrid(‘getrows’);

    var filterGroup = filterGroups[filterGroups.length-1];
    if(filterGroup == undefined){

    $(“#grid”).jqxGrid(‘clearfilters’);

    }else{
    if(filterGroup != null){
    filter_column = filterGroup.filtercolumn;
    alert(‘filter_column:’ + filter_column);

    for (var j = 0; j < dataFieldsOfGrid.length; j++) {
    var items = [];
    if(filter_column == dataFieldsOfGrid[j].name){
    continue;
    }
    for(var i = 0; i < rows.length; i++)
    {
    var row = rows[i];
    var dataFieldName = dataFieldsOfGrid[j].name;
    if(items != null){
    var flag=1;
    for(var m = 0; m < items.length; m++)
    {
    if(items[m] == row[dataFieldName]){ flag=0; break;}
    }
    }
    if(flag == 1){
    items.push(row[dataFieldName]);
    }
    }

    $(“#grid”).jqxGrid(‘setcolumnproperty’, dataFieldsOfGrid[j].name, ‘filteritems’, items);
    }
    }
    }
    });

    The code is working fine for cascade filtering (on suppose 4-5 columns). But filteritems in filter checkedlist may not remain correct if we clear filters from the filter dropdown by clciking on clear button(there are 2 buttond Filter and Clear in filter dropdown).

    The column JSON is given below for my grid:-

    {“text”:”Invest Style”,”pinned”:false,”hidden”:false,”width”:112,”filtertype”:”checkedlist”,”datafield”:”Invest_Style”},
    {“text”:”Market Seg”,”pinned”:false,”hidden”:false,”width”:110,”filtertype”:”checkedlist”,”datafield”:”Market_Seg”},
    {“text”:”Portfolio Code”,”pinned”:false,”hidden”:false,”width”:114,”filtertype”:”checkedlist”,”datafield”:”Portfolio_Code”},
    {“text”:”Sri”,”pinned”:false,”hidden”:false,”width”:103,”filtertype”:”checkedlist”,”datafield”:”Sri”},
    {“text”:”Style Category”,”pinned”:false,”hidden”:false,”width”:114,”filtertype”:”checkedlist”,”datafield”:”Style_Category”},
    {“text”:”Tax Status”,”pinned”:false,”hidden”:false,”width”:110,”filtertype”:”checkedlist”,”datafield”:”Tax_Status”},
    {“text”:”Type”,”pinned”:false,”hidden”:false,”width”:104,”filtertype”:”checkedlist”,”datafield”:”Type”},
    {“text”:”Attribute”,”pinned”:false,”hidden”:false,”width”:109,”filtertype”:”checkedlist”,”datafield”:”Attribute”},
    {“text”:”Value”,”pinned”:false,”hidden”:false,”width”:105,”filtertype”:””,”datafield”:”Value”}

    and other data related grid is :

    $(“#grid”).jqxGrid(
    {
    theme: ‘energyblue’,
    width: 98 + ‘%’,
    height: 250,
    filterable: true,
    // sortable: true,
    source: dataAdapter,
    selectionmode: ‘multiplecellsadvanced’,
    columnsresize: true,
    columns: columnsOfGrid
    }

    I have also called ‘clearFilters’, but my problem is not resolved. Problem is, if we clear all the filters one by one, when last filter is cleared, its filter items are not getting reset. Is there any option to reset filter items?

    Please provide the solution ASAP.


    neha
    Participant

    Thanks Vladimir.


    neha
    Participant

    Looks like screenshot is not attached.

    Description is :
    for data shown above, if users enters ‘Ch’ in Filter suggestion input box, the checked boxes list
    shopuld show only :

    Chocolate1
    Chocolate2
    Chocolate3

    and user can select any one of them. Such that ‘getfilterinformation’ method will return checked values and NOT the typed ‘Ch’


    neha
    Participant

    Thanks Dimitar.

    in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #76818

    neha
    Participant

    Thanks Vladimir.

    in reply to: Cascaded Filter in JqxGrid Cascaded Filter in JqxGrid #76782

    neha
    Participant

    Hi Vladimir,

    Thanks for the quick reply.

    The issue is not related to data population in grid according to filter applied. The issue is with data in Filtered checkedlist( in Select Filter Dropdown).
    e.g Data is given below for grid:-
    Country City (These are headers)
    India Bombay
    India Delhi
    US NJ
    US NY

    When applied filter as ‘India‘ on Country column, Grid shows me 2 rows as given below:-

    Country City (These are headers)
    India Bombay
    India Delhi

    but, when i applied filter again on City column on this data , filter drop down shows four values (Bombay, delhi, NJ, NY). Filter drop down must show 2 values now (Bombay, Delhi).

    Filter dropdown should shown/change values according to currently loaded data in grid.

    But, Filter Dropdown is showing all the values (with all the values when the grid is loaded very first time).

    I want to apply Excel like Auto Filter feature.

    Thanks,
    Neha


    neha
    Participant

    Thanks Peter.

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