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 ... 11
1
I am using:

Code: [Select]
groupModel: {
on: true,
header: false,
grandSummary: true,
agg: {"PRICE":"sum"}
},
summaryTitle:{sum:""},

The issue is that long decimals come from the server data which are converted to the correct currency (thus many decimal places needed) and rounded in the colModel.render which is all fine.  However when if I lets say get three PRICE values of 1.004, 1.004, 1.004, the total is 3.012 which rounds to 3.01 which is wrong as it should be 3.00 (1.00 + 1.00 + 1.00) as each row was rounded to 1.00.

How do I override the sum function, or add a custom sum function to round before adding each cell in the grouped column?  Also the cell needs to be rounded for Excel output due to the same issue in spreadsheet apps.

I've tried below but it doesn't work:

Code: [Select]
formulas: [
[
"sum",
function(rd)
{
return Math.round(rd.cellData * 100) / 100;
}
]
],

2
Bug Report / Very, very minor bug for depricated JS
« on: August 24, 2025, 10:25:04 pm »
In my console I am getting a depricated alert for filesaver.js:

Quote
Unload event listeners are deprecated and will be removed.
1 source
filesaver.js:232

Line 232 in filesaver.js is:
Code: [Select]
view.addEventListener("unload", process_deletion_queue, false);
Chrome links me to this page regarding the deprecation: https://chromestatus.com/feature/5579556305502208

3
Help for ParamQuery Pro / Create a filter that is a <select>
« on: August 04, 2025, 08:24:14 pm »
I want to use a select as a filter and not the standard pqGrid selector.  The following works, but seems messy:

Code: [Select]
rating_filter = {
crules:[{condition:"contain"}],
// type:"select", // HAS NO EFFECT
init: function(ui)
{
// Cretae a new <select>
var sel = $("<select>", {style:"width:100%; text-align:"+dir})
.insertAfter(ui.$editor)
.change(function(){ ui.$editor.val(this.value).change(); });
// Hide the input
ui.$editor.hide();
// Add the options
$("<option>", {html:"All", value:""}).appendTo(sel);
for(let i=0; i<6; i++)
$("<option>", {text:"★".repeat(i), value:i}).appendTo(sel);
ui.listener = "change";
// Hide the clear icon
ui.$cell.find("span.pq-clear-icon").hide();
// Send back message all good
return true;
}
};

Is there a better way?

4
Help for ParamQuery Pro / Re: Drag & drop rows without the diDrag icon
« on: August 04, 2025, 04:12:01 pm »
Is there a way to do it without using sortable, and just pqGrid native as I still need to select row?

5
Sorry, one more thing.  The drag and drop in a normal grid and a tree grid is very different.  The tree you drag and drop the entire row, the grid only a handle icon.

The tree grid is really strange and hard to understand and is not similar to the normal tree that uses a horizontal line. All other trees use a line or an indicator arrow to show if the drop is inside, above, below, or at the parent (the arrows indent).  A really good example is https://preview.keenthemes.com/html/keen/docs/general/jstree/dragdrop.

6
Help for ParamQuery Pro / How do I undo a moveNode event
« on: July 31, 2025, 03:11:02 pm »
If I drag and drop a node, but saving it on the server has an error, I want to be able to undo/revert the move.  How do I do this?

colModel = {
moveNode: function(event, uiDrop) {
  if(ajax_error)
       undo_this_move(uiDrop);
  }
}

7
Should have mentioned, to work how jQueryUI Sortable works, or even use Sortable would be great

8
Help for ParamQuery Pro / Drag & drop rows without the diDrag icon
« on: July 31, 2025, 01:25:58 am »
Is there a way to drag and drop the entire row without using the drag helper?

I did below but this means there is a drag-handler icon:

Code: [Select]
dragModel: {
on: true,
diDrag: "QTY",
tmplDrag: '<span class="ui-icon ui-icon-grip-dotted-vertical pq-drag-handle" style="cursor:move; vertical-align:text-bottom; touch-action:none; float:left;">&nbsp;</span>',
diHelper: ["QTY", "NAME"]
},
dropModel: {
on: true
},
moveNode: function(e, uiDrop){ console.log(uiDrop); }

I don't want the diDrag drag-handler icon and just want to drag anywhere on the row to initiate the drag (I am already using row selection).  I thought of trapping a mouse down event and after a move of a certain amount of pixels, manually trigger a drag start, but not sure how?

9
Should have mentioned that I already did this.  Just wondered if there was another way.  Thanks

10
In my grid, some cells have filters, others don't.  In one of the columns that does NOT have a filter (so the filter cell is blank), I want to insert my own HTML element.  How do I do this?

11
Help for ParamQuery Pro / Equivalent of getNode(ID) for a normal grid
« on: July 20, 2025, 04:01:10 am »
In a treeGrid I can get a node using getNode() and passing the ID value in the rowData.

The only way to do this I can see on a normal grid is to create a lookup object {"1234":row, ...} once the data has loaded from the remote source.  Is there a better way?

12
Help for ParamQuery Pro / Re: Column filter on remote source override
« on: July 15, 2025, 02:30:20 am »
It doesn't work.  "return false" does not prevent the remote data call or even passing the parameters to the remote data call

13
Help for ParamQuery Pro / Column filter on remote source override
« on: July 13, 2025, 07:46:19 pm »
I have a grid with multiple columns and different filter options that uses a remote data source.

One column filter (being a range drop down grid), when options are selected, I don't want to trigger a reload or even a filter, I want to call my own function that does it's own thing, does NOT request data to loaded remotely, that has nothing to do with the grid and does not affect the grid.

Is this possible and how can I do it?

14
Bug Report / Bugs in format for dates with times in a tree
« on: May 03, 2025, 10:20:13 pm »
I spotted two bugs, but only if pqGrid is a treeModel
  • "mm/dd/yyyy" does not work, I have to use "mm//dd/yyyy" (notice the double "//" to get a single one to show)
  • "mm//dd/yyy hh:mm" does not work as documented, it shows the month instead of the minutes.

In one of the demos on the pqGrid v10 demo page I set "format" and/or "fmtDateFilter"

15
Suggest new features / Filter multi select - Apply button
« on: April 02, 2025, 06:56:44 pm »
When data is remote, every time a user selects an option on the drop down, the data reloads causing more server traffic.  It would be great to have an option for Apply or Cancel buttons and selections are ignored untileither is pressed.

Pages: [1] 2 3 ... 11