froadie
froadie

Reputation: 83063

Why is my jqGrid dropdown filter removing the column values?

I have a jqGrid with the filterToolbar enabled. For one column, Status, I wanted to have a dropdown filter with preset options rather than a free text filter.

What the column looks like in the colModel:

colModel: [ 
    ...
    {name: 'status', label: 'Status', formatter: 'select', stype: 'select', searchoptions: {value: ':All;ACTIVE:Active;INACTIVATED:Inactive'}},
    ...
  ],

The filter actually works, but the values in the status column are all blank. So when I select "Active" from the filter, all the rows with a Status value of "ACTIVE" are displayed, but it doesn't actually display anything in the Status column.

Here's what the column looks like with "All" selected (and actually displaying all rows regardless of status):

enter image description here

Why are the status values hidden?

Upvotes: 0

Views: 676

Answers (1)

Oleg
Oleg

Reputation: 221997

You use formatter: 'select' which required either to define editoptions with value property or to define formatoptions with value property. Try to add

editoptions: {value: 'ACTIVE:Active;INACTIVATED:Inactive'}}

to the definition of the column status. Be careful to use the values in the input data for the column if you use formatter: 'select'. I mean that the input data for the column status have to be the values "ACTIVE" or "INACTIVATED" instead of "Active" or "Inactive", which will be displayed in the grid.

Upvotes: 1

Related Questions