ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: Jongki, Baek on August 24, 2018, 01:20:53 pm
-
Hi.
I am looking for answers to two questions.
1) When I import data using ajax, I want the PgGrid to refresh (update).
* sample source
2) It is Spring-based data that is provided as sample when saved as excel.
I want a JSP-based source.
-
1. Please make yourself familiar with ajax request response lifecycle of grid.
https://paramquery.com/pro/tutorial#topic-loaddata
Example of remote request: https://paramquery.com/pro/demos/filter_header
2. JSP source is not available, request and response is independent of any server language / framework.
You need to be familiar with elementary GET/POST requests and JSON serialization / deserialization.
Excel export ( if that's what you need ) can be done in browser itself without round trip to server.
https://paramquery.com/pro/demos/export_local
-
1) When I import data using ajax, I want the PgGrid to refresh (update).
button click
call aaa.jsp?type=a grid display
another button click
call aaa.jsp?type=b grid display
-
Solution is already mentioned on this page:
https://paramquery.com/pro/tutorial#topic-loaddata
Assign the response from your ajax call to grid and call refreshDataAndView
grid.option('dataModel.data', response);
grid.refreshDataAndView();
-
Thank you for your help.
try, return Message:
The object does not support the 'refreshDataAndView' property or method.
I added a text file
----------------------------------------------------------------------------------
function setData()
{
var datag1 = [
[1, 'Exxon Mobil', '339938.0', '36130.0'],
[2, 'Wal-Mart Stores', '315654.0', '11231.0'],
[3, 'Royal Dutch Shell', '306731.0', '25311.0'],
[4, 'BP', '267600.0', '22341.0']
];
$("#grid_array").pqGrid( 'option', 'dataModel.data', datag1 ).refreshDataAndView();
//************************************************************************
//* return Message:
//* The object does not support the 'refreshDataAndView' property or method.
//************************************************************************
// grid.option('dataModel.data', datag1 );
// grid.refreshDataAndView();
}
-
pqGrid methods can be called in 2 alternative ways: https://paramquery.com/pro/tutorial#topic-methods
refreshDataAndView can't be called on jQuery variable directly, please update it to pqGrid( 'refreshDataAndView ' )
-
It was solved with your help.
However, another problem occurred.
Some data is missing when exporting Excel.
Please check the data.
-
Could you please share a jsiddle instead of attachments.
-
Hi.
I attached the file you requested.
But, pqgrid.min.js is file size over. not add.
pqgrid.min.js INFO
/**
* ParamQuery Pro
*
* Copyright (c) 2012-2018 Paramvir Dhindsa (http://paramquery.com)
* Released under Evaluation license
* http://paramquery.com/pro/license/evaluate
*
*/