ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: omerix on March 06, 2019, 01:12:46 am
-
Hello,
I am using paramquery form as details table.
I want to post both my form and grid with a single button.
https://yadi.sk/i/7efYV49XKLBeVA
It is possible to operate the Grid function from the outside?
https://yadi.sk/i/DuspqD3ZZRaVAw
-
There is nothing like calling function from inside or outside the grid. Any method in the grid can be called as long as there is reference to the grid.
grid.method_name();
If you want to save your form data in grid, then addRow or addNodes method can be used.
https://paramquery.com/pro/api#method-addNodes
If you want to post changes in the grid to remote server, then get the changes with getChanges method and post them with jquery ajax call.
https://paramquery.com/pro/api#method-getChanges
-
Hello,
I want to do this.
I add the following code to the example at this address. "https://paramquery.com/pro/demos/editing_batch"
HTML
<div id="grid_editing" style="margin: auto;"></div>
<button onclick="saveChanges();">Save Button</button>
Click "Save Button". Console Message:
Uncaught ReferenceError: saveChanges is not defined at HTMLButtonElement.onclick (editing_batch:1) onclick @ editing_batch:1
How can I solve this problem?
There is nothing like calling function from inside or outside the grid. Any method in the grid can be called as long as there is reference to the grid.
grid.method_name();
If you want to save your form data in grid, then addRow or addNodes method can be used.
https://paramquery.com/pro/api#method-addNodes
If you want to post changes in the grid to remote server, then get the changes with getChanges method and post them with jquery ajax call.
https://paramquery.com/pro/api#method-getChanges
-
It's because the saveChanges function scope ( defined in that demo ) is within the closure whereas inline added functions to html are called in global window scope.
So please change this
function saveChanges() {
to this
window.saveChanges = function() {
-
Thanks Param. Worked :)
It's because the saveChanges function scope ( defined in that demo ) is within the closure whereas inline added functions to html are called in global window scope.
So please change this
function saveChanges() {
to this
window.saveChanges = function() {