ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: jaguar23 on October 04, 2017, 11:44:25 pm
-
Hi,
i want to build an inline editable grid with filters and frozen columns, is the connection of these features possible?
I started with the 'Auto Save' example and my MySQL table is showing nicely, but any edits I do are gone after page reload.
I don't get any errors in the web dev console and none in the apache log. How do you debug this kind of technology? (I am not a frontend dev obviously)
Regards,
J.
-
I got filtering and freezeCol to work too.
As far as I understand the PHP-code the addList, updateList and deleteList function do not write into the MySQL-table, which means they have to be implemented by hand?
-
So far I came up with this code:
function deleteList($deleteList){
foreach ($deleteList as $row)
{
$primaryKey = $row["uid"];
$sql = "DELETE FROM MYTABLE WHERE uid='".$primaryKey."'";
$dsn = 'mysql:host='.DB_HOSTNAME.';dbname='.DB_NAME;
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
);
$dbh = new PDO($dsn, DB_USERNAME, DB_PASSWORD, $options);
$stmt = $dbh->prepare($sql);
$stmt->execute();
}
return $deleteList;
}
This does not work, the MySQL command does not even get triggered.
Can anybody explain to me, what I am getting wrong?
-
Have you added this part. And were you able to debug your code. The deleteList function is called only when there are deleted records in the grid.
if( isset($_GET["pq_batch"]))
{
session_start();
$dlist = $_POST['list'];
if(isset($dlist["updateList"])){
$dlist["updateList"] = updateList($dlist["updateList"]);
}
if(isset($dlist["addList"])){
$dlist["addList"] = addList($dlist["addList"]);
}
if(isset($dlist["deleteList"])){
$dlist["deleteList"] = deleteList($dlist["deleteList"]);
}
echo json_encode($dlist);
}
-
Thank you very much for you answer!
Yes, that code is in there too, I took the Auto Save example code as template.
I am still not sure how to debug it best, I am watching the web dev console and the apache and mysql logs for now; since my MySQL code does not even get triggered, I assume that whole function does not get called, which means it fails at the code you posted or before...
-
I used the this template:
https://paramquery.com/pro/demos/editing_instant
-
Me too
I have a same problem... and I am a pro buyer
Please help me....
-
It's expected that you have working knowledge of javascript/ jquery and php and bit familiar with debugging your code.
Please follow this example:
https://paramquery.com/pro/demos/editing_instant
In this example, lists are saved in session. You might need to change the code to save it in your database.
If you face issues, please mention all details and share your code / plnkr
https://plnkr.co/edit/zo6TdOvweAFvWM5JLasV?p=preview