I have a filter combobox on my page above the grid which fills a _POST[filterId].
In the php part I read the filterId from my database and fill my select_command from the grid by using my baseSql added with my predefine filter from the database. Looks like:
$sql = $baseSql.’ where ‘.$filterStr;
$maingrid->select_command = $sql;
$rendergrid = $maingrid->render(‘mygrid’);
<?php echo $rendergrid; ?>
The first time the grid is filled well. But after submit the new selected filter the sql is filled well but the grid still shows the same data.
Is the a re-render function I have to call?
POST data need session persistence. For complete details, refer this faq:
Problem isn\\\’t Post data I think. I can add: $_SESSION[\\\”mainsql\\\”] = $sql; but that will nothing change. When I print or echo $sql the value is correct. $sql = $baseSql.’ where ‘.$filterStr; $_SESSION[\\\”mainsql\\\”] = $sql; $maingrid->select_command = $sql; $rendergrid = $maingrid->render(‘mygrid’); <?php echo $rendergrid; ?>
Share complete code that is involved in your question. You can use Github Gist to share code link.