2

I have a Grid for which I have a column formatted to a link. Once I click on a link that is being generated, this link will take me to a page for which the url looks like ?page=details&id=10. This works fine, so far.

On this details page I have another grid which displays child records, by adding the condition to the model of the grid addCondition("parent_id", "=", $_GET["id"]). This works well as well, my child records are being displayed based on the master record id that is being passed.

Now if I add a quickSearch on the grid from the details page, once I try to search, the id is not being passed in the url, so now my condition will be addCondition("parent_id", "=", null) because $_GET["id"] is null. The url that is being generated for the refresh is ?page=details&submit=agile_details_mvcgrid_quicksearch. So the grid will display no results. How can I fix this? I could put the value in the session, but it's really a good solution.

zadof
  • 69
  • 5

1 Answers1

1

Please add the following at the top of your page:

$this->api->stickyGET('id');

This will preserve value of $_GET['id'] form that point on.

romaninsh
  • 10,606
  • 4
  • 50
  • 70