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 - jplevene

Pages: [1] 2 3 ... 15
1
Uncaught TypeError in cKeyNav.bodyKeyDown when typing in an empty grid with groupModel enabled (v11.1.0)

Description:
When groupModel is active but the grid currently contains no data (empty dataModel.data), clicking on the grid body to give it focus and typing any character on the keyboard causes a fatal Javascript exception.

Steps to Reproduce:
  • Initialize a pqGrid (v11.1.0) with groupModel enabled.
    Ensure the grid has no rows (dataModel.data: []).
    Click inside the empty grid body so it gains focus (the .pq-focus-mgr element).
    Type any alphanumeric key.

Expected Behavior:
The grid should quietly ignore the keystroke since there are no rows to navigate or jump to via Keyboard Navigation.

Actual Behavior:
The internal keyboard navigation ($.paramquery.cKeyNav.bodyKeyDown) intercepts the keystroke and attempts to jump to a row starting with the typed character. It triggers a selection event but fails to verify if the row actually exists before trying to read the pq_gtitle property of an undefined object, resulting in a crash.

Error Trace:
Uncaught TypeError: Cannot read properties of undefined (reading 'pq_gtitle')
    at $.<computed>.<computed>.<anonymous> (pqgrid.min.js?v=11.1.0:752:459)
    at handleListeners (pqgrid.min.js?v=11.1.0:39:329)
    at _pq_.trigger (pqgrid.min.js?v=11.1.0:41:19)
    at $.paramquery.cKeyNav.bodyKeyDown (pqgrid.min.js?v=11.1.0:335:462)
    at fn.onKeyDown (pqgrid.min.js?v=11.1.0:195:239)
    at HTMLDivElement.<anonymous> (pqgrid.min.js?v=11.1.0:195:403)
    at HTMLDivElement.dispatch (jquery-4.0.0.min.js:2:37917)
    at v.handle (jquery-4.0.0.min.js:2:35897)

Proposed Internal Fix (for pqGrid core):
In cKeyNav.bodyKeyDown or the internal row iteration logic for grouping, ensure rowData is defined before evaluating rowData.pq_gtitle or rowData.pq_gsummary.

Temporary Workaround / App-Level Fix:
For anyone else experiencing this in the meantime, you can bypass the crash by attaching a capture-phase keydown listener to the grid container to kill the event before cKeyNav can intercept it:

Code: [Select]
// Bind this immediately after initializing the grid
gridContainer[0].addEventListener("keydown", function(e) {
    var gridData = $(this).pqGrid("option", "dataModel.data");
   
    // Is the grid totally empty?
    if (!gridData || gridData.length === 0) {
        // Allow typing in external inputs/filters, but block empty grid body key navigation
        if (!$(e.target).is("input:not(:checkbox), textarea, select") || $(e.target).hasClass("pq-focus-mgr") || $(e.target).parent().hasClass("pq-focus-mgr")) {
            e.stopImmediatePropagation();
            e.stopPropagation();
        }
    }
}, true); // useCapture = true

2
Help for ParamQuery Pro / Date column filter with lte, equal or gte
« on: April 20, 2026, 10:01:52 pm »
I want to add a filter for a date column with lte, equal or gte options for the date selected in the datepicker.

  • The filter is only for the date (not the time) and each cell is formatted "YYYY-MM-DD hh:mm:ss" and is UTC.
  • Each cell has a render that converts the UTC to local so it is displayed in the local format and timezone in the cell (data is still UTC)
  • The filter is to work only on the date part, being lte, equal OR gte (ignore the time part)
  • The date picker is obviously local format and timezone
  • I also use moment (see examples below)

Basically I need to have a datepicker in the column filter, limited to a choice of lte, equal or gte and the date chosen in the drop down fileter needs to be converted to UTC before compare to the data (I could even include the time at start and end of the day for the compare so it could be a simple string compare)


I use moment so I can convert a local date to UTC by:
as_utc = moment(local_date).utc();
startUtc = moment(local_date).startOf('day').utc().format("YYYY-MM-DD HH:mm:ss");
endUtc = moment(local_date).endOf('day').utc().format("YYYY-MM-DD HH:mm:ss");
etc...



3
Help for ParamQuery Pro / selectModel bug
« on: April 20, 2026, 05:03:59 am »
Setting selectModel to below:

Code: [Select]
selectionModel: { type:"row", mode:"single", column:false, all:false, toggle:false},
Even though toggle is false, it still toggles.

My temporary fix for anyone else with the same issue is below:

Code: [Select]
rowClick: function(event, ui) {
var sel = that.grid.pqGrid("SelectRow");
if( !sel.isSelected({rowIndx:ui.rowIndx }) )
sel.add({rowIndx:ui.rowIndx});
},

4
Help for ParamQuery Pro / Re: Another 11.1.0 bug
« on: April 05, 2026, 04:09:03 am »
Do you have a temporary fix to this until the next version is released, or is the next version with the bug fixes going to be released soon.

5
Help for ParamQuery Pro / Re: exportRender not working
« on: March 25, 2026, 11:15:20 pm »
Even setting it to "false" didn't work.

It's not a problem for me as I just used "skipExport" and in "render" I do a different export for export.

Looking at it again, the API guide isn't clear as it says:

column.exportRenderType: Boolean
Rendered cell values ( otherwise raw cell data ) in this column are included in the exported data when this option is true.
This option overrides render parameter of exportData() method for the current column.

Maybe  the second line above should be:
When this option is true (default), the rendered cell (if render is used) is exported, otherwise the raw cell data value is exported.

6
Looked into this further, by me setting the style option, it completely removed the padding from the input instead of adding a style to it.  Had the padding been due to a CSS class, then this wouldn't have happened.  I think it should be a CSS class, which also means that if I want to change the style in the style option, it will do so.

So for instance if I do "color:red" in the style option, the padding will disappear.

This is why I this is a bug and not a help request.

7
Help for ParamQuery Pro / Re: exportRender not working
« on: March 25, 2026, 06:39:43 pm »
Was about to update my above comment, exportRender:false also doesn't work.  I am applying this to a detail grid on the icon type:"deatil" column

Even exportRender:function(ui){return false;} does not work

I tried skipExport:true which works obviously, however this column is the first column and is frozen which causes the next column to be frozen, or in the case of my grid the 3rd column as the first two are frozen

8
Help for ParamQuery Pro / exportRender not working
« on: March 25, 2026, 05:46:04 pm »
It doesn't seem to be calling the function:

exportRender:function(ui){ return { text:ui.rowData["noChild"]?"":"+" }; }

9
Help for ParamQuery Pro / Re: Expanding detail row
« on: March 22, 2026, 02:19:36 am »
Thanks, really helped and far better than my idea.

Would be really nice as a feature. 

For others, I did it programatically so that it only affected one grid with an id of "my_grid" and not all of them:

Code: [Select]
// Override the prototype using a standard function but only for the availability grid
const pq_grid_defaultGetPadding = $.paramquery.cHierarchy.prototype.getPadding;
$.paramquery.cHierarchy.prototype.getPadding = function() {
// In pqGrid modules, 'this.that.element' holds the jQuery object of the grid
const gridId = this.that && this.that.element ? this.that.element.attr('id') : null;
if(gridId === 'my_grid')
return { paddingLeft: 25 };
else
return pq_grid_defaultGetPadding ? pq_grid_defaultGetPadding.apply(this, arguments) : { paddingLeft: 0 };
};
const styleTag = document.createElement('style');
styleTag.textContent = `
#hh_availability_grid .pq-detail {
z-index: 90 !important; /* Optional: add !important if another stylesheet is overriding it */
background: #fff;
}
#hh_availability_grid .pq-cont-right {
z-index: unset;
}
`;
document.head.appendChild(styleTag);

10
Help for ParamQuery Pro / Re: Expanding detail row
« on: March 21, 2026, 02:12:01 am »
How would you suggest I do it?

As you can see I made it transparent and it seemed fine.  I remeber the previous bug but there are three backgrounds as I added an extra one to the second frozen row.  I'm suggesting just making the standard 2 transparent, ad column 2 as you can see is wider than the other columns, so the narrow columns will never reach behind the icon column, but even if it does, I can just give it another background.

11
Help for ParamQuery Pro / Re: Expanding detail row
« on: March 20, 2026, 09:40:19 pm »
How would you suggest changing the background like I suggested?  Would you suggest doing it in rowInit, render, columnPostRender, etc?

Also please could I add a feature request for a setting in "detailModel" for "useFrozenColumns" as it is just wasted space.  This option would just make the blank space transparent and remove the vertical line and replace it with a shorter one.  Also mouse events ignore so the transparent area can be clicked through.

12
Help for ParamQuery Pro / Expanding detail row
« on: March 20, 2026, 02:52:34 am »
Firstly, the rowExpand event is missing, so I have had to resort to using beforeRowExpand with a timeout.

Please see the attached images.  My first two columns are frozen, being the icon column and the "Name" column.  When the row expands, all the blank space in the fixed columns is wasted, and I want to get the green box to use it.  Is this possible and how?

The only way I thought was to make the div.pq-table-left and its div.pq-grid-row children have no background.  The only issue is the "border-right" that has been left behind (second screen shot).

P.S. If you are wondering, I have a script in the scroll and beforeRowExpand event that positions the green box so that it is always in that position and the correct width

13
I found where it is going wrong

.pq-theme input, .pq-theme textarea, .pq-theme select {
...
padding: .2em .28em;
...
}

But it is only one of the cells (see image) because I added },

style:"text-align:left"

14
Everthing is visible, its just too many options goes under the drop arrow so it gets confusing.

You have set the padding in the style as 16px (not em) and not in a class assigned to (maybe like "pq-grid-hd-search-field-drop-down"), so when I do something like below, it goes wrong:

Code: [Select]
depot_filter = {
crules: [{condition:"range", value:[]}],
selectGridObj: function(ui) {
// Change the label render
ui.obj.colModel[0].renderLabel = function(ui){ return htmlEntities(ui["rowData"]["NAME"]); };
ui.obj.colModel[0].sortable = false;
},
//options: [], // Set below
gridOptions: {
stripeRows: false, // No stripey rows
numberCell: {show: false}, // Hide the number column
filterModel: {header: false},// Hide search box in the dropdown
focusModel: { focusable: false, onTab:""}, // Prevent the focus box
selectionModel: {type:null, column:false} // Disable row selection
},
title: function(sel, ui, column){
var s = "";
if(!empty(sel))
for(var i = 0; i < sel.length; i++) {
s += (s===""?"":", ") + depots_ids[ sel[i] ];
}

return s;
}
};

15
I have added a feature request as other grids have have ways to disable cell selection.

Pages: [1] 2 3 ... 15