jQWidgets Forums

jQuery UI Widgets Forums Grid Reloading filter drop down lists

This topic contains 4 replies, has 2 voices, and was last updated by  mjf784927 11 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Reloading filter drop down lists #45862

    mjf784927
    Participant

    Is there a way after the grid loads and a filter is applied that the filter row drop down lists can be refreshed? I am using server side calls to bring in a chunk of data at a time but have a method to update the source for the filteritems datasource. Just need a way to refresh the filterrow with that new data.

    { text: ‘Domain’, filtertype: getFilterType(filterLists.Domain), filteritems: filterLists.Domain, datafield: ‘Domain’, pinned: true, renderer: columnrenderer, cellsrenderer: cellsrenderer, width: 120 }

    Thanks
    Mike

    Reloading filter drop down lists #45880

    Peter Stoev
    Keymaster

    Hi Mike,

    Have you tried the “refreshfilterrow” method?

    Best Regards,
    Peter Stoev

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

    Reloading filter drop down lists #45930

    mjf784927
    Participant

    Yes I have…here’s a small piece of test code:

    $(“#jqxgrid”).on(“filter”, function (event) {
    alert(“filter changed”);
    $.ajax({
    url: filterablesURL + “?reporttype=” + reporttype + “&reportname=” + reportname,
    type: “POST”,
    dataType: “json”,
    cache: false,
    }).done(function (data) {
    data.AgentStatus = [99, 98, 97];
    data.ServerStatus = [‘xxxxxx’];
    alert(data.AgentStatus);
    alert(data.ServerStatus);
    filterLists = data;
    alert(filterLists.AgentStatus);
    alert(filterLists.ServerStatus);
    $(‘#jqxgrid’).jqxGrid(‘refreshfilterrow’);
    })
    });

    Basically just for testing I called the same code when it detects the filter change as I call in the initial load to populate the filter ddl’s. Then I changed a few values and called the ‘refreshfilterrow’. The ddl’s keep their original values. I see the new values in my test alerts.

    Reloading filter drop down lists #45935

    Peter Stoev
    Keymaster

    Hi Mike,

    I suppose that you will have to update the column’s filteritems property before calling “refreshfilterrow”. Otherwise, you will refresh the same row and the same items.

    Best Regards,
    Peter Stoev

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

    Reloading filter drop down lists #45939

    mjf784927
    Participant

    That did it!

    I added:

    $(‘#jqxgrid’).jqxGrid(‘setcolumnproperty’, ‘AgentStatus’, ‘filteritems’, filterLists.AgentStatus);
    $(‘#jqxgrid’).jqxGrid(‘setcolumnproperty’, ‘ServerStatus’, ‘filteritems’, filterLists.ServerStatus);

    and actually did not need the:

    $(‘#jqxgrid’).jqxGrid(‘refreshfilterrow’);

    works like a champ!

    Thanks
    Mike

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

You must be logged in to reply to this topic.