ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: Richard on March 04, 2022, 06:19:57 am
-
Hi
I am trying to make a program that reads and modifies data in the database and saves it in the database.
Auto save (https://paramquery.com/pro/demos/editing_remote_page) among the demo programs is similar, so
I saved the source file displayed on the demo screen on my computer and ran it with a web browser.
No data is displayed on the screen.
I would like to receive a complete example file.
-
The javascript displayed under the example has been copied and pasted to the index.js file in stackblitz. Also the urls has been changed from relative to absolute. :)
And id of grid has been updated to grid_editing in index.html
https://stackblitz.com/edit/paramquery-demo-import-xlsx-6phwhz
-
Copy each demo program at the link address you gave me (https://stackblitz.com/edit/paramquery-demo-import-xlsx-6phwhz?file=index.js)
After creating a file and saving it on my computer, edit the url in the index.js file
I searched using a web browser (http://127.0.0.1/index.html).
As a result, the data stored in the DB is not displayed and only the message 'No rows to display' is displayed.
As a result of inquiring the server program (http://127.0.0.1/products.php) with a web browser,
the DB data was accurately displayed and searched as shown below.
DB connection OK!!
{"data":[{"ProductID":1,"ProductName":"AA","QuantityPerUnit":1,"UnitPrice":2,"UnitsInStock":3,"Discontinued":true},
{"ProductID":2,"ProductName":"BB","QuantityPerUnit":11,"UnitPrice":22,"UnitsInStock":33,"Discontinued":false}]}
Even if you search after editing the url in the index.js file (add https://paramquery.com/pro/),
only the message 'No rows to display' is displayed.
All files used for the test are attached.
Please help what the problem is.
-
When you open http://127.0.0.1/products.php in your web browser, the correct output should be:
{"data":[{"ProductID":1,"ProductName":"AA","QuantityPerUnit":1,"UnitPrice":2,"UnitsInStock":3,"Discontinued":true},
{"ProductID":2,"ProductName":"BB","QuantityPerUnit":11,"UnitPrice":22,"UnitsInStock":33,"Discontinued":false}]}
DB connection OK!! line should not appear in the output.
PS: It's convenient to use web developer console of browser to resolve the issues related to interaction of pqgrid or any js control with remote scripts.
-
As you mentioned, after modifying the program,
I connected to http://127.0.0.1/index.html and the DB data was displayed on the screen.
Thank you very much.
However, after modifying some of the data displayed on the screen and clicking the 'Save Changes' button,
When Reload(F5) is performed, the data is the same as before modification.
Even when I tried Reload (F5) after pressing the 'Delete' button and clicking the 'Save Changes' button,
The data is not deleted and it is the same as before.
Please help me with what's wrong.
-
Please correct your code in saveChanges function in index.js file.
data: {
//JSON.stringify not required for PHP
list: gridChanges
},
-
Your help solved the problem.
Thank you so much :)