0

There are two table t1 and t2

t1 id, name 1, abc 2, pqr

t2 id, t1_id, phone 1 , 1 , 7894561230 2, 1 , 7894645125 3, 2, 7445582145

I am having two grids, grid 1 showing the first table. Now if i clicked on 1st item. I should see the second grid with only t1_id == clicked item.

Both are UI grid

When i am clicking on an item it call the controller with parameter id. Now how can i filter the other grid with this id?

  • 1
    Can you please more elaborate your question with code so we get more idea about it? – Rutvee Sojitra Aug 27 '18 at 12:57
  • please check i have edited my question. – Avesh Naik Aug 27 '18 at 13:05
1

As you mentioned you have UI grids, means in the second grid you must have a Dataprovider, you can check there if there is a, id available in the post then you can filter(by using addFieldToFilter() ) it according to id or will show all the data.
And, as you mentioned you have two tables then you can also put a join(by using getSelect()...) to fetch data from both the tables.

  • Well i don't have dataprovider. – Avesh Naik Aug 27 '18 at 14:07
0

I found the solution To use session. What i observed was the constructor of the collection was getting called 3 times, this were erassing the data of request params.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.