You should have State relationship in transaction model. I hope there is direct relationship between transaction and states.
To be sure, share your gridview transaction/index.php, transaction and state model.
Thats the issue there is no direct relationship between state and transaction it would have been straight forward if there was. What i want to do is Display the state name for each transaction in the transaction Gridview index.php
is three solutions:
a) in search query add join with status table - more complicate sql request;
b) in gridview column use function, what request for each cell status name - wrong. For each cell send request to DB
c) in view get status list and pass to column function by use and label get from status list - very good
Hi @femibiwoye thanks for your response. I already did something like this earlier agent.state.name but i think agent.state.state_name should work. I will try it shortly and get back to you. By the way please i have another question here is the link: Display status selectbox as Active or Not-Active in YII2 Gridview .