Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - afterhours2

Pages: [1]
1
Help for ParamQuery Pro / Delete header rows
« on: March 04, 2023, 02:18:04 am »
Hi,

ParamQuery version: v8.5

I would like to hide/delete the highlighted rows from the grid. Your help will be much appreciated.


2
Hi,

Your Second Solution:
   
Code: [Select]
open: function (evt, ui) {                   
                $("#grid_popup").pqGrid(obj);
         },
         close: function () {               
            $("#grid_popup").pqGrid( 'destroy' );
            pqIS.init();
         },

The above code in your previous comment is not working. When grid makes backend call, I see reset page request (requestpage) as 1 instead of 0 (The pagination request in the backend Java call). Looks like "destroy" command is not working in this case.

Moreover, I am not getting data on the grid, instead I am getting below Exception on the browser console (I am getting data on Grid B only during the first call, on subsequent calls I am getting the below Exception).

   pqgrid.dev.js:26887 Uncaught TypeError: Cannot read properties of undefined (reading 'pq_hidden')
      at pqgrid.dev.js:26887:17
      at Array.findIndex (<anonymous>)
      at pq.cRenderBody.init (pqgrid.dev.js:26886:27)
      at $.paramquery.cRefresh.refresh (pqgrid.dev.js:8307:18)
      at fn.refresh (pqgrid.dev.js:4290:17)
      at fn.refreshView (pqgrid.dev.js:4299:8)
      at fn._onDataAvailable (pqgrid.dev.js:9222:8)
      at Object.callback (pqgrid.dev.js:4347:11)
      at fn.onRemoteSuccess (pqgrid.dev.js:4183:9)
      at Object.success (pqgrid.dev.js:4140:10)

      
      
Your First solution:
   "you are supposed to call pqIS.init() to clear the loaded data and reset page request to 0 in gridB.
   and call gridB.refreshDataAndView() to reload new data in gridB."

   
   This solution was kind of working, It was able to fetch and update data on every change, but problem here was that it makes 2 backend calls everytime when I open Grid B (When I open Grid B, the first time it makes 2 calls, on page scroll it makes only 1 call)

3
Help for ParamQuery Pro / Re: Unable to Resize the column
« on: February 11, 2023, 02:03:57 am »
We have grid implemented in one of other projects which uses Paramquery v3.2. The grid code is similar to the previous project. I am able to expand grid in the old project.

I am getting below exception from the console. would this help ?

jquery-1.11.0.js:248 Uncaught Error: no such method 'instance' for draggable widget instance
    at Function.error (jquery-1.11.0.js:248:9)
    at HTMLDivElement.<anonymous> (jquery-ui-1.10.4.custom.js:491:15)
    at Function.each (jquery-1.11.0.js:384:23)
    at jQuery.fn.init.each (jquery-1.11.0.js:137:17)
    at $.fn.<computed> [as draggable] (jquery-ui-1.10.4.custom.js:483:9)
    at _pq.cResizeColumns._setDragLimits (pqgrid.dev.js:7400:14)
    at HTMLDivElement.helper (pqgrid.dev.js:7354:11)
    at $.<computed>.<computed>._createHelper (jquery-ui-1.10.4.custom.js:1749:49)
    at $.<computed>.<computed>._createHelper (jquery-ui-1.10.4.custom.js:401:25)
    at $.<computed>.<computed>._mouseStart (jquery-ui-1.10.4.custom.js:1565:22)

4
Thanks param, I updated the grid B as below

Close pop-up section- made below changes: added 2 lines, removed 1 line
=====================
pqIS.init();
pqIS.requestPage = 0;
// $("#grid_popup").pqGrid("destroy");

Open pop-up section: added "refreshDataAndView"
====================
$("#grid_popup").pqGrid("refreshDataAndView");               
         

pop-up section after updating the code:
========================================

 $("#transHistoryBtnworkovertime").button().click(function (evt) {
            $("#popup")           
            .dialog({
                height: 460,
                width: 900,
                modal: true,
               
                open: function (evt, ui) {   
                   
                   $("#grid_popup").pqGrid(obj);
                   $("#grid_popup").pqGrid("refreshDataAndView");
                },
                close: function () {
                   
                   pqIS.init();
                   pqIS.requestPage = 0;
                },
                show: {
                    effect: "highlight",
                    duration: 100
                }
            }).prev(".ui-dialog-titlebar").css({"background":"#006f66","height":"17px","font-size":"12px","vertical-align":"center"});
        }



As expected, I see only new data on the pop-up Grid B

However I see few issues, The first time I click on any new radio button, Grid B works perfectly fine. During subsequent calls,

Issue 1: For Example, If I scroll down to 5 to 10 pages and close pop-up Grid B, the next time when I try to open Grid B with a different record, it makes 2 backend calls to fetch 2 pages instead of 1

Issue 2: Row number column is missing. But I can see row number column when the page loads and I open pop-up for the first time

Issue 3:  For some reason, it reached the Error block when I open the pop-up and I see the error message displayed on the screen(But data is getting refreshed)
   
    error: function (jqXHR, textStatus, errorThrown) {
               $("#workovertimeResult").text("Failed to Reload Data, Please Try again").css("color", "red");
       }
      
      
I think all of these are connected to 1 issue. Please let me know if I missed anything or did incorrectly   

Attached Updated Grid B code   



5
Hi,

ParamQuery version: v8.5

I am facing issue deleting the grid data when I close the pop-up. To further elaborate,

I am working on two Grids: Grid A and Grid B. Grid A loads data when the webpage opens. Grid A has radio button. On each rowselect of Grid A, Grid B is updated by making a backend Java call to Fetch data

Data in Grid B is shown in form of pop-up window

Requirement:
==========
I want data from Grid B to be deleted when I close the pop-up and when I click on a different Radio button on Grid A, only the data related to that particular record should be displayed on Grid B

Issue:
========
1) When I close the pop-up of Grid B, the data is not getting deleted, and when I select a different radio button from Grid A and open the Grid B pop-up, both old and new data is displayed.

2) Pagination details is not reset to zero. Example: If I scrolled down to 5 pages, and now when I select a different radio button, pagination details is not reset to default

I used the below code when i close the pop-up

$("#grid_popup").pqGrid("destroy")

Below is Jsp code:

   <div title="Grid in Dialog" id="popup" style="overflow:hidden;">
      <div id="grid_popup"></div>
   </div>

Any help would be much appreciated.

Please find the attached code samples for reference

6
Help for ParamQuery Pro / Unable to Resize the column
« on: January 19, 2023, 02:31:00 am »
Hi Team,

I am using Paramquery pro v8.5

I am unable to resize the column even after setting the column.resizable to "True". I see that the cursor changes to "col-resize" on hover, however when I click and drag, column does not resize.

Below is the code, Thanks in advance

$(function () {
        var pqIS = {
            totalRecords: 0,
            pending: true,
            rpp: 25, //records per request.           
            init: function () {
                this.data = [];
                this.requestPage = 0;
            }
        };
        pqIS.init();

        var obj = {
            selectionModel: { type: null },
            scrollModel: {
                autoFit: false
            },
            postRenderInterval: -1,
            numberCell: { width: 50},           
            title: "Crew List",
            virtualX: true, virtualY: true,
            resizable: true,
            filterModel: { on: true, header: true, type: 'remote' },
            sortModel: { type: 'remote', sorter: [{ dataIndx: 'employeeNo', dir: 'up'}] },
            beforeSort: function (evt) {
                if (evt.originalEvent) {//only if sorting done through header cell click.
                    pqIS.init();
                }
            },
            beforeTableView: function (evt, ui) {
                var finalV = ui.finalV,
                    data = pqIS.data;
                if (ui.initV == null) {
                    return;
                }
                if (!pqIS.pending && finalV >= data.length - 1 && data.length < pqIS.totalRecords) {
                    pqIS.requestPage++;
                    pqIS.pending = true;
                    //request more rows.
                    this.refreshDataAndView();
                }
            },
            rowSelect: function (evt, ui) {
               
            $("#Id").val(ui.addList[0].rowData.id);
               
            }
        };
        obj.colModel = [
            { title: 'Select', align: 'center', editable: false,sortable: false, resizable: true,
             render: function (ui) {
                return "<input type='radio' name='radio100'/>";
             },
             postRender: function (ui) {               
                var grid = this;
                $(ui.cell).find('input').prop('checked', ui.rowData.pq_rowselect).on('change', function (evt) {                           
                   grid.SelectRow().replace({ rowIndx: ui.rowIndx });
                });
             }
            },
           
            { title: "Employee No", dataIndx: 'employeeNo', minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true },
            { title: "First Name", dataIndx: 'firstName' , minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true  },
            { title: "Last Name", dataIndx: 'lastName', minWidth: 120,maxWidth: 200, align: "center" , sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true    },
           
        ];
       
       
        obj.dataModel = {           
            dataType: "JSON",
            location: "remote",
            url: "CrewListGrid.do",
            postData: function () {
                return {
                    pq_curpage: pqIS.requestPage,
                    pq_rpp: pqIS.rpp
                };
            },
            getData: function (response) {
                var data = response.data,
                    len = data.length,
                    curPage = response.curPage,
                    pq_data = pqIS.data,
                    init = (curPage ) * pqIS.rpp;
                pqIS.pending = false;
                pqIS.totalRecords = response.totalRecords;
                for (var i = 0; i < len; i++) {
                   
                    pq_data[i + init] = data;
                }
               window.scrollTo(0,document.body.scrollHeight);
                return { data: pq_data }
            },
            error: function (jqXHR, textStatus, errorThrown) {
               //alert("reached error");
               //$(operationResponse).val("Error");
               document.getElementById("gridCrewResult").innerHTML = "Failed to Reload Data, Please Try again";
                //displayError("Failed to Reload Data", "errorId_crewlist");
            }
           
        };

        $("#grid_infinite").pqGrid(obj);
    });

7
Help for ParamQuery Pro / Unable to concatenate 2 dataindx fields
« on: January 10, 2023, 10:20:42 pm »
Hi,

We are using pro v8.5 in our organisation. I am trying to concatenate 2 fields from Java object to display on the grid, However the below logic is returning empty on the Grid screen. I am trying to concatenate supervisorFirstName and supervisorLastName


{ title: "Supervisor", pq_fn:{dataIndx: 'CONCATENATE(supervisorFirstName,supervisorLastName)'}, minWidth: 100,maxWidth: 400, align: "center"  }

I used the below link as reference: https://paramquery.com/forum/index.php?topic=3821.0

Not sure, if I am missing anything here, any help would be much appreciated.


Thanks,
Syed

8
Help for ParamQuery Pro / Radio Button option for the column
« on: December 06, 2022, 05:08:42 am »
Hello,

I am using Paramquery v8.5.0. I am working on a functionality to add radio button to each row of the table, which will enable user select only one row from the list. Data from the select row will be used for further processing.

Below is the code we are currently using for checkbox, need to update this to Radio button functionality

 obj.colModel = [
         {title: "Select", dataIndx: "flag", type: 'checkbox', maxWidth: 30, align: "center", cls:'checkboxColumn',
                resizable: true, editor: false, sortable: false ,editable:true, cb: { all: false, header: true, check: "Y", uncheck: "N" }
            },
            { title: "Employee No", dataIndx: 'empNo', minWidth: 50,maxWidth: 100, align: "center" },
            { title: "First Name", dataIndx: 'firstName' , minWidth: 100,maxWidth: 400, align: "center" }
]

Screenshot attached, need help to update the checkboxes highlighted in yellow to Radio buttons.

Any help on this would be much appreciated


Pages: [1]