Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
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!
42
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"
},
43
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!

44
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.
45
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!
46
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>
47
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'} );
48
Help for ParamQuery Pro / Re: Changing the font size of everything in the grid
« Last post by paramvir on April 16, 2025, 06:59:01 am »
The css rule needs to be placed after the css files of pqgrid.

Code: [Select]
<style>
.pq-grid{
  font-family: Arial, sans-serif;
  font-size: 20px;
}
</style>

https://jsfiddle.net/8h7gadys/
49
Help for ParamQuery Pro / Changing the font size of everything in the grid
« Last post by pbassey on April 16, 2025, 01:07:21 am »
Can you tell me what the command is in ParamQuery to set the entire grid to the following:
.pq-grid {
  font-family: 'Arial', sans-serif;
  font-size: 14px;
}

I placed the above style setting just about the javascript and it did not have any effect on the font size of the text in the grid.

Thanks...
50
Help for ParamQuery Pro / Re: R2L Support in Edge & Chrome on "Virtual-X: True"
« Last post by paramvir on April 09, 2025, 09:55:05 am »
Please use this patch to fix the RTL issue.

Code: [Select]
    //fix for RTL.
    pq.scrollLeft = (ele, val) => {
        if (val == null) {
            return Math.abs(ele.scrollLeft)
        }
        else {
            val = Math.abs(val);
            if ($(ele).css('direction') == 'rtl') {
                val = -1 * val;
            }
            ele.scrollLeft = val;
        }       
    }
    pq.scrollLeftVal = (ele, val) => Math.abs(val)

Demos in RTL can be viewed by appending rtl to the url.

https://paramquery.com/pro/demos?rtl
Pages: 1 ... 3 4 [5] 6 7 ... 10