Rendering of inactive entries in list page using SelectModel

I have the following issue with SelectModel.
Say I have defined a customer_id attribute in ngRestAttributeTypes() as follows :

 'customer_id' => [
    'selectModel', 'modelClass' => Customer::className(), 
    'valueField' => 'id', 
    'labelField' => 'name',
    'where'=> ['is_active'=>1],

All’s working fine. The customer name is displayed properly in the list. I have a nice dropdown list in the add/update forms with active only customers.
The problem occurs when I turned one old customer to inactive. The dropdown lists are well rendered ignoring the inactive entry but my list is showing an id instead of the name in the Customer column for entries using the inactive one.
I am not sure if this is an expected behavior or not. But for me I am expecting that inactive entires won’t appear in the dropdown lists but should be rendered properly in the list page.

i think this is expect, because it can not find the name in the list (array of users) anymore. Maybe you could use Build any web thing! — LUYA

Yes but the SelectRelationActiveQuery is not rendering a dropdown list which I need actually…
As a workarround I added an extra field to be shown in the list and am using the original field in the create/update but this is not fancy…

1 Like

the “where” should work, so the inactive items should not appear in the dropdown list.
Is that logic?

not sure to understand this right but ngRestFind() is used to defined the list for the crud views while the “original” find() is used for all other queries (f.e. in frontend, blocks, controllers etc)

1 Like

is there anyway to fill the result match requirements?

sorry i don’t understand your question, please more in details what you are looking for otherwise i am unable to help. There are ngRestFilters maybe this helps you to filter the grid list, once the user has selected a filter it stores in the user settins