Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Help for ParamQuery Pro / Storing states in database
« Last post by queensgambit9 on May 13, 2025, 01:16:55 pm »
Hi

I am currently using states (localstorage). Is there a tutorial or example on how to instead store in database along with user data. Using MySQL/PHP.

Thanks in advance.
12
Bug Report / Bugs in format for dates with times in a tree
« Last post by jplevene 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"
13
Sorry for late reply.

It can be done in beforeValidate, check if ui.source == 'paste' and there are objects of type: 'add' in ui.rowList, then remove them.

https://paramquery.com/api#event-beforeValidate
14
Help for ParamQuery Pro / Re: Pivot Grid - Default Aggregate function for Columns
« Last post by mlipham on April 28, 2025, 09:34:59 pm »
Ah! Lovely - thank you sir!
15
Help for ParamQuery Pro / Re: Pivot Grid - Default Aggregate function for Columns
« Last post by paramvir on April 28, 2025, 09:13:52 pm »
count can be added by updating summaryOptions for numbers.

Code: [Select]
summaryOptions: {
number: "avg,max,min,stdev,stdevp,sum,count"
},
16
Help for ParamQuery Pro / Re: Pivot Grid - Default Aggregate function for Columns
« Last post by mlipham on April 28, 2025, 08:09:55 pm »
Yes - you are correct. After further analysis, I understand my ticket a little better - apologies.
And yes, the example behavior seems to match what I am seeing in our development.

Allow me to ask a follow-up.

The example https://paramquery.com/pro/demos/pivot has Gold in the aggregates box (lower right), along with Silver bronze and total.

After re-reading my (internal) request again, I think the question is - why is count not available for the number types?
Is that something I can code to add into the list of aggregate choices for numbers?

Many thanks as always!

17
Help for ParamQuery Pro / Re: Pivot Grid - Default Aggregate function for Columns
« Last post by paramvir on April 27, 2025, 10:18:43 pm »
I don't see the mentioned side effect in this patched example: https://paramquery.com/pro/demos/pivot

Athlete is string datatype column and it defaults to "count" when dropped to aggregates pane, I can still see the count option in the dropdown list of available options for that dataType.

Available options for a dataType in aggregate pane are picked from summaryOptions: https://paramquery.com/pro/api#option-summaryOptions

Have you updated the summaryOptions dynamically somewhere in your code? It could be causing the side effect.
18
Help for ParamQuery Pro / Re: Pivot Grid - Default Aggregate function for Columns
« Last post by mlipham on April 26, 2025, 01:56:37 am »
The patch works great , but now i have a weird side effect(?).

We have a mix of data types that can be dragged into the aggregate section.
And now with this code - dragging in a string defaults to count() - awesome.
However, if I click on it again to change the aggregate function, 'count' is no longer a choice - it is simply missing.
This means that if I changed to say, 'sum', or 'avg', then wanted to return to 'count', I no longer have that choice in the menu.

Any hints?

thanks again!
19
Help for ParamQuery Pro / Re: Changing the font size of everything in the grid
« Last post by paramvir on April 16, 2025, 08:34:00 pm »
There might be other css rules on the page that can affect it.

Either you find and resolve those rules or override other rules by adding !important to the affected css rule.

Code: [Select]
<style>
.pq-grid{
  font-family: Arial, sans-serif !important;
  font-size: 20px !important;
}
</style>
20
Help for ParamQuery Pro / Re: Changing the font size of everything in the grid
« Last post by pbassey on April 16, 2025, 06:08:10 pm »
Thank you.  I implemented the style setting just below the pggrid .css styles (inside the <body> tag as well as in the <head> section), but neither  appear to affect the font size of the grid. 

Are there any other settings that might override this?
Below is my pggrid settings:

    function exportXlsx() {
        var $t = this.toolbar(),
            hlAlternateRows = $t.find('.alternateRows').prop('checked');

        var blob = this.exportData({
            format: 'xlsx',
            eachRow: function (row, ri, rowData, rows) {
                if (hlAlternateRows && rows.length % 2 != 0) {
                    row.bgColor = "#f0f0f0";
                }
            },
            linkStyle: "text-decoration:underline;color:#0d6efd;",
            skipHiddenCols: $t.find('.xHCols').prop('checked'),
            skipHiddenRows: $t.find('.xHRows').prop('checked'),
            selection: $t.find('.selectedRows').prop('checked') ? 'row' : '',
            render: $t.find('.render').prop('checked')
        });
        pq.saveAs(blob, "USIndustrySummaryData.xlsx");
    }
   function groupChg(val){
      var lower = Math.floor( val/ 10 ) * 10,
          upper = Math.ceil( (val + 1)/ 10 ) * 10;
      return lower + " < " + upper;
   };

   var obj = {
      height: 340,
      width: '100%',
      title: 'CCI/CI Summary',
      showTitle: false,
      numberCell: {show: false},
      rowBorders: true,
      dataModel: {
         location: "remote", //server side call
         dataType: "jsonp",
         method: "GET",
            url: "/IND/Account/grid_summary?YearVal=" + theYear, //URL
         getData: function (dataJSON) {
            var data = dataJSON.data;
            return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
         }
      },
        colModel: [
            { dataIndx: 'grp', title: 'Source', tpHide: true, menuInHide: true, minWidth: 150 },
            { dataIndx: "Source", title: "Cost/Expense Items", hidden: true, filter: { groupIndx: 'CCIAccountDesc' } },
            { dataIndx: "CCIAccountDesc", title: "Cost/Expense Items", minWidth: 450 },
            { dataIndx: "Actual_YTD", title: 'ACTUAL YTD', valign: "top", format: '$ #,###,###.00', summary: { type: "sum" }, valign: "top", align: "right", minWidth: 130 },
            { dataIndx: "Projections", title: 'PROJECTIONS', valign: "top", format: '$ #,###,###.00', summary: { type: "sum" }, valign: "top", align: "right", minWidth: 140 },
            { dataIndx: "Proj_Total", title: 'PROJ TOTAL', valign: "top", format: '$ #,###,###.00', summary: { type: "sum" }, valign: "top", align: "right", minWidth: 130 },
            { dataIndx: "Budget", title: 'BUDGET', valign: "top", format: '$ #,###,###.00', summary: { type: "sum" }, valign: "top", align: "right", minWidth: 130 },
            { dataIndx: "Variance", title: 'VARIANCE', valign: "top", format: '$ #,###,###.00', summary: { type: "sum" }, valign: "top", align: "right", minWidth: 130 },
            { dataIndx: "Notes", title: 'NOTES', valign: "top", minWidth: 250 }

        ],
        groupModel: {
            on: true,                                  //grouping mode.
            pivot: false,                               //pivotMode
            checkbox: false,
            checkboxHead: false,
            select: true,
            titleIndx: 'grp',                            //v7.0.0: new option instead of titleInFirstCol
            indent: 20,
            fixCols: false,
            groupCols: ['CCIAccountDesc'],                   //grouping along column axis.
            header: false,                               //hide grouping toolbar.
            grandSummary: true,                         //show grand summary row.
            dataIndx: ['Source'],                         //grouping along row axis.
            collapsed: [true],
            useLabel: true,
            summaryEdit: false
      },
      summaryTitle: {sum: "" },
        pageModel: {
            type: "remote", //Paging remote
            rPP: 100, strRpp: "{0}", //default paging parameters
        },
      wrap: false,
      hwrap:false,
      editable: false,

      toolbar: {
          cls: 'pq-toolbar-export',
          items: [
                {
                    type: 'button',
                    label: "Export to Excel(xlxs)&nbsp;",
                    icon: 'ui-icon-arrowthickstop-1-s',
                    listener: exportXlsx
                },
              {
                  type: 'textbox',
                  label: "Filter: ",
                  attr:'placeholder="Enter text"',
                  listener:{timeout: function (evt) {
                      var txt = $(evt.target).val();
                      var rules = this.getCMPrimary().map(function(col){
                          return {
                              dataIndx: col.dataIndx,
                              condition:'contain',
                              value: txt
                          }
                      })
                      this.filter({
                          mode: 'OR',
                          rules:rules
                      })
                  }}
              }
          ]
      },
      toolPanel:{
          show: false  //show toolPanel initially.
      },

      //use pivotCM event to make grouped columns collapsible.
      pivotCM: function(evt, ui) {
          //add collapsible to grouped parent columns.
          this.Columns().each(function(col){
              var cm = col.colModel
              if(cm && cm.length>1 && !col.collapsible)
                  col.collapsible = {on: true, last: true};
          }, ui.CM);
      }
   };
   var grid1 = pq.grid( "#Summary", obj);
   grid1.option( "selectionModel", {type: 'row', mode: 'single'} );
Pages: 1 [2] 3 4 ... 10