1
Help for ParamQuery Pro / Re: Passing Variable to Grid
« on: February 10, 2015, 10:58:56 pm »
My issue does relate to the grid as it involves getting the proper data to appear in the grid. Let me see if I can explain this a little better.
There are three files
receiverdetail.php This file is my application file and where the grid is called in a div. This file also contains a variable $dsd_combo_key
receiverdetailgrid.php This file is the .php file for the grid and is called by receiverdetailgrid.js
receiverdetailgrid.js This is the javascript file for the grid
The variable $dsd_combo_key is a combination of two variables $dsd_vendor and $dsd_vendor_invoice_number. This number is created from a form that calls receiverdetail.php upon submit. In order to make sure the grid is pulling the right information I need to be able to query the database and pull only items with the correct $dsd_combo_key in the grid on the receiverdetail.php.
Here is my dilemma... receiverdetail.php has both the variable and the code for the div. When the div is called it then executes receiverdetailgrid.js which calls receiverdetailgrid.php and executes SQL depending on whether the action is select, insert, or delete. On the select in receiverdetailgrid.php I need to be able to give that SQL statement a where ( where dsd_detail_combo_key='$dsd_combo_key') that uses the variable from the initial page that contains the div. That Where clause will only display information that has the same $dsd_combo_key.
So my question is how would I get that data to the grid? I'm sure there are other people out there that would like to use the grid dynamically depending on data from a form to create the grid. But I can't seem to understand how to pass that variable from .php to .js to .php so that I can get the proper variable data for my select statement.
There are three files
receiverdetail.php This file is my application file and where the grid is called in a div. This file also contains a variable $dsd_combo_key
receiverdetailgrid.php This file is the .php file for the grid and is called by receiverdetailgrid.js
receiverdetailgrid.js This is the javascript file for the grid
The variable $dsd_combo_key is a combination of two variables $dsd_vendor and $dsd_vendor_invoice_number. This number is created from a form that calls receiverdetail.php upon submit. In order to make sure the grid is pulling the right information I need to be able to query the database and pull only items with the correct $dsd_combo_key in the grid on the receiverdetail.php.
Here is my dilemma... receiverdetail.php has both the variable and the code for the div. When the div is called it then executes receiverdetailgrid.js which calls receiverdetailgrid.php and executes SQL depending on whether the action is select, insert, or delete. On the select in receiverdetailgrid.php I need to be able to give that SQL statement a where ( where dsd_detail_combo_key='$dsd_combo_key') that uses the variable from the initial page that contains the div. That Where clause will only display information that has the same $dsd_combo_key.
So my question is how would I get that data to the grid? I'm sure there are other people out there that would like to use the grid dynamically depending on data from a form to create the grid. But I can't seem to understand how to pass that variable from .php to .js to .php so that I can get the proper variable data for my select statement.