ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: pbassey on October 28, 2022, 09:00:40 pm

Title: Displaying more than one grid at the same page
Post by: pbassey on October 28, 2022, 09:00:40 pm
When I try to create a page that uses the PQGrid grid control more than once on the same page, the page loads fine, but the grid data is only displayed one of the grids.

Is there a way to display multiple grids on the same "tabbed" page??

Thanks,
Peter
Title: Re: Displaying more than one grid at the same page
Post by: paramvir on October 28, 2022, 09:35:54 pm
Any number of grids can be displayed on a single page.

Every grid should have independent initialization options and data.

Example: https://paramquery.com/pro/demos/copy_paste
Title: Re: Displaying more than one grid at the same page
Post by: pbassey on November 04, 2022, 11:52:03 pm
Can you provide an example where there are 2 grids on the same html page - both importing from 2 different excel files and both are loaded with data in the 2 grids at the same time on that same html page??
Title: Re: Displaying more than one grid at the same page
Post by: pbassey on November 05, 2022, 02:13:02 am
Can the importXL function be integrated into the following code (below) so the dataModel points to an Excel file rather than data from the generateData function?

        function getObj( index ){
            var rows = 20,
                cols = 10,
                skipHiddenCols, 
                skipHiddenRows,
                includeHeader,            
                toLetter = pq.toLetter,               
                data = index == 0? pq.generateData(rows, cols): [],
                CM = [];

            for (var i = 0; i < cols; i++) {
                CM = { title: toLetter(i), width: 155 };
            }           

            var obj = {
                showTitle: false,
      height: 500,
      colModel: CM,
      dataModel: {data: data}                               
            };

            return obj;
        }
        pq.grid("#KPMGData", getObj(0));

Title: Re: Displaying more than one grid at the same page
Post by: paramvir on November 06, 2022, 05:50:49 pm
grid API can't point directly to Excel file.

First Excel file is imported into grid and updated grid data can be exported back to original Excel file as mentioned here:

https://paramquery.com/forum/index.php?topic=4478.msg16085#msg16085