Author Topic: populating filter select  (Read 2291 times)

stevejacobsen

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
populating filter select
« on: May 19, 2016, 06:32:49 am »
I have this in my colmodel:

            {title: "Aisle", width: 50, dataIndx: "Aisle", align: "center",
                filter: {
                    type: 'select',
                    condition: 'equal',
                    listeners: ['change']
                }
            },

and this in my obj var:

            create: function (evt, ui) {
                var grid = this,
                        column;
                $.getJSON("utilities/ajax_getaisles_JSON.php", function (response) {
                    column = grid.getColumn({dataIndx: 'Aisle'});
                    column.filter.options = response;
                });

            },


it puts 76 items in the options array but they don't display.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: populating filter select
« Reply #1 on: May 19, 2016, 08:08:59 am »
Code: [Select]
column = grid.getColumn({dataIndx: 'Aisle'});
column.filter.cache = null; //clear previous cache if any.
column.filter.options = response;
grid.refreshHeader();

stevejacobsen

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: populating filter select
« Reply #2 on: May 19, 2016, 08:27:06 am »
Perfect! Thanks!