Recent Posts

Pages: [1] 2 3 ... 10
1
Suggest new features / Renewal
« Last post by dudhaiyag on Today at 12:14:51 pm »
My subscription expired and I would like to signup for pro support.  What is the link and the cost?
2
Help for ParamQuery Pro / Re: Default state
« Last post by paramvir on August 27, 2025, 08:42:36 pm »
Yes, it’s possible to implement a “Set as Default” button in the toolbar using the saveState and loadState APIs. Here’s the approach:

Save the selected state as a string
When the user clicks your “Set as Default” button, call saveState and save the returned string somewhere persistent—like local storage or your database. For example:

Code: [Select]
const defaultState = grid.saveState({ stringify: true });
localStorage.setItem('myGridDefaultState', defaultState);

Load this default state on page load
On page load, retrieve the saved state string and pass it to loadState:

Code: [Select]
const savedState = localStorage.getItem('myGridDefaultState');
if (savedState) {
    grid.loadState({ state: savedState, refresh: true });
}
3
Help for ParamQuery Pro / Default state
« Last post by queensgambit9 on August 27, 2025, 05:55:03 pm »
Would it be possible to have a button in the toolbar to set a selected state as "default" (to be loaded on page load)?
4
Help for ParamQuery Pro / Re: "groupModel" and "sum" floating point solution needed
« Last post by paramvir on August 27, 2025, 09:51:24 am »
This is how you can define a custom aggregate to round the numbers before aggregating them.

Code: [Select]
pq.aggregate.sumRound = function(arr, col) {
   let rounded = arr.map(val => parseFloat(Number(val).toFixed(2)));
   return pq.aggregate.sum(rounded, col);
};

Now sumRound can be used in groupModel as

Code: [Select]
agg: {"PRICE":"sumRound"}
5
Help for ParamQuery Pro / "groupModel" and "sum" floating point solution needed
« Last post by jplevene on August 26, 2025, 11:20:13 pm »
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;
}
]
],
6
Bug Report / Re: Very, very minor bug for depricated JS
« Last post by paramvir on August 24, 2025, 10:42:25 pm »
there is no need to use filesaver.js

pq.saveAs API can be used: https://paramquery.com/pro/api#method-saveAs
7
Bug Report / Very, very minor bug for depricated JS
« Last post by jplevene 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
8
Help for ParamQuery Pro / Create a filter that is a <select>
« Last post by jplevene 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?
9
Help for ParamQuery Pro / Re: Drag & drop rows without the diDrag icon
« Last post by paramvir on August 04, 2025, 04:27:13 pm »
sortable + pqgrid also works with selectionModel: {type: 'row'}

however in pqgrid native DnD, a row can't be dragged without a drag helper / icon.
10
Help for ParamQuery Pro / Re: Drag & drop rows without the diDrag icon
« Last post by jplevene 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?
Pages: [1] 2 3 ... 10