Hallo,
can someone explain(or a sample) how to get the a value on server-side by using the phpconnector?
I want send a value to the php-script to specify the SQL-Statement and then render the table.
Hallo,
can someone explain(or a sample) how to get the a value on server-side by using the phpconnector?
I want send a value to the php-script to specify the SQL-Statement and then render the table.
Please provide some more details - are you need to get values from the data to be saved, or some custom one ?
On client side you can change the url to dataprocessor like
dp.serverProcessor = “my.php?from=”+somevar;
The next data saving call will include “from” parameter, that you can use in connector’s configuration.
Custom value
My test code:
client-side
...
var mygrid,myDP;
function doOnLoad(){
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Name,Category,Ingredients");
mygrid.attachHeader("#connector_text_filter,#connector_select_filter,#connector_select_filter");
mygrid.setInitWidths("200,80,*");
mygrid.setColTypes("ro,ed,ed");
mygrid.setColSorting("str,connector,str");
mygrid.init();
mygrid.load("griddata.php");
myDP = new dataProcessor("griddata.php");
myDP.serverProcessor = "griddata.php?test=testvalue";
myDP.init(mygrid);
...
server-side .php
$test = $_GET['test'];
echo $test;
i become the message “undefined index”?
If you need it during data loading you can set it directly as part of load command
mygrid.load("griddata.php?test=testvalue");