ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: orlando_acevedo on December 05, 2018, 12:13:54 pm

Title: filter options from database
Post by: orlando_acevedo on December 05, 2018, 12:13:54 pm
Hi pqTeam,

I have an infinite scrolling grid that I am upgrading to version 5.6. Since the data is loaded incrementally, I need to feed the filter options directly from the database.
The code I found on the forum and documentation is not working though, and when runs, it makes the filter be blank.
Here is what I have:
Code: [Select]

$.getJSON('@Url.Action("AuditFilterOptions", "Audits")', function (data) {

            filterMG = $("#grid_audits").pqGrid("getColumn", { dataIndx: 'ManagementGroup' }).filter;
            filterMG.cache = null;
            filterMG.options = data.ManagementGroups;

            $("#grid_audits").pqGrid("refreshHeader");
        });




Thank you,

OA
Title: Re: filter options from database
Post by: paramvir on December 05, 2018, 12:57:25 pm
data.ManagementGroups should be array of objects in this format.

Code: [Select]
[
  {ManagementGroup: val1},
  {ManagementGroup: val2},
  {ManagementGroup: val3},
  ...
]
Title: Re: filter options from database
Post by: orlando_acevedo on December 06, 2018, 10:49:06 pm
That worked.


Thank you!!!


OA.