Author Topic: Filter in 5.2.0 - custom select dropdown  (Read 2415 times)

pqgridprouser1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Filter in 5.2.0 - custom select dropdown
« on: July 30, 2018, 03:54:06 pm »
Hi

We have recently upgraded to 5.2.0 and as part of migration we have changed the existing code as per the API 5.2.0 where we have  created the pqgrid with:
Code: [Select]
               
               filter: {

                type: "select",
                init: function() {
                $(this).pqSelect({radio: true});
                        },
                crules: [{condition: "equal"}],
                valueIndx: "value", labelIndx: "text",
                mapIndices: {"text": "text", "value": "value"},
                options: [{'text': 'All', 'value': ''}, {'text': 'Yes', 'value': 'true'}, {'text': 'No', 'value': 'false'}],
                listeners: ['change']
                }

In the header section, I need a select box which shows given options with pqSelect plugin, but it is still displaying the default text box. Please suggest an alternate method for this.
NOTE: The above code was working in previous version.

Thanks

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Filter in 5.2.0 - custom select dropdown
« Reply #1 on: July 30, 2018, 04:47:51 pm »
pqSelect is no longer supported in filter row ( as mentioned in upgrade guide ).

In v5.2.0, you can remove all parameters beside crules: [{condition: "equal"}] in filter definition and let the grid provide default UI.

If you need a dropdown, then you would require condition: 'range' instead of condition: 'equal'.

Here is an example to customize filter in various ways:

https://paramquery.com/pro/demos/filter_custom
« Last Edit: July 30, 2018, 05:06:25 pm by paramquery »