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

Pages: [1] 2 3 ... 427
1
Help for ParamQuery Pro / Re: PHP 7 -> PHP 8
« on: May 15, 2025, 05:27:41 pm »
IS {"data":[{"c":1}} data of host grid or the remote filter options?

Could you share a jsfiddle.

2
Help for ParamQuery Pro / Re: Storing states in database
« on: May 13, 2025, 08:05:26 pm »
There is no demo for saving it in db as the process also involves user authentication to tie / associate the state with the user.

If you have user authentication already in place, then the process is quite simple:

first receive the state as string with saveState method and pass save: false to the method so as to avoid saving it to localStorage.

post the state string to remote url along with user token id and save it in a single field corresponding to the user in a table.

Get the state corresponding to the user whenever required and use loadState method to restore the state of the grid.

https://paramquery.com/pro/api#method-saveState

https://paramquery.com/pro/api#method-loadState

3
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

4
count can be added by updating summaryOptions for numbers.

Code: [Select]
summaryOptions: {
number: "avg,max,min,stdev,stdevp,sum,count"
},

5
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.

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

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

8
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

9
In v3.3, localization strings for English are included in the grid itself, so no need to include localization file for English.

In Pro version, however you are required to include the localization file as mentioned in the Tutorial section.

https://paramquery.com/pro/tutorial#topic-include

You can refer to the example for dynamically changing the locale here: https://paramquery.com/pro/demos/localize

10
Bug Report / Re: New row comit and pq_detail column
« on: March 25, 2025, 11:20:17 pm »
pq_detail and column with type: "detail" are not the same. pq_detail is a property of the rowData while column of type: 'detail' is used for nesting or row details.

11
Bug Report / Re: New row comit and pq_detail column
« on: March 25, 2025, 03:24:55 pm »
pq_detail is not used in the colModel in any of the nesting / row details examples.

Have you tried removing pq_detail from colModel.

12
refresh() is required after refreshCM() to see the new colModel in view.

PS: There are inbuilt options to control the save and load state properties.

https://paramquery.com/pro/api#option-stateColKeys

https://paramquery.com/pro/api#option-stateKeys

13
Bug Report / Re: New row comit and pq_detail column
« on: March 21, 2025, 11:46:01 am »
I don't understand why you have added pq_detail in the colModel. Can you please clarify?

14
Help for ParamQuery Pro / Re: Using loadState in grouped fields
« on: March 20, 2025, 06:10:22 pm »
Thanks for mentioning the steps.

Please add this patch to fix the error.

Code: [Select]
jQuery.paramquery.pqGrid.prototype.loadState=function(e){e=e||{};var t,o=this,r=$.widget.extend,d=e.state||o.getState();if(!d)return!1;pq.isStr(d)&&(d=JSON.parse(d));var a,l=d.colModel,i="pid"+Math.random(),n={},s={},p={},h=o.options,M=e=>e.dataIndx||e.id||e.title,c=(delete(a=h.stateColKeys).colModel,delete a.dataIndx,a),f=h.colModel,u=(e,t,o,r)=>{var d=o[t]={};e.forEach(((e,a)=>{var l=M(e);e.parentId=t,r[l]=e,d[l]=a,e.colModel&&u(e.colModel,l,o,r)}))};for(var g in u(l,i,s,n),p[i]={colModel:f},u(f,i,{},p),p){var v=n[g],N=p[g];if(v){if(N.parentId!=v.parentId){var w=p[N.parentId],I=p[v.parentId];I&&(w.colModel.splice(w.colModel.indexOf(N),1),I.colModel.push(N))}o._saveState(v,N,c)}}return function e(t,o){var r=s[o];r&&t.sort((function(e,t){return r[M(e)]-r[M(t)]})),t.forEach((t=>{delete t.parentId;var o=t.colModel||[];o.length&&e(o,M(t))}))}(f,i),o.iCols.init(),r(h.sortModel,d.sortModel),r(h.pageModel,d.pageModel),o.Group().option(d.groupModel,!1),o.Tree().option(d.treeModel,!1),t={freezeRows:d.freezeRows,freezeCols:d.freezeCols},isNaN(1*h.height)||isNaN(1*d.height)||(t.height=d.height),isNaN(1*h.width)||isNaN(1*d.width)||(t.width=d.width),o.option(t),!1!==e.refresh&&o.refreshDataAndView(),!0};

and ensure to use v10.x of pqgrid since support for grouped columns in state is not available in older versions.

15
I understand that's incorrect behavior of pqgrid pivot to use default aggregate as "sum" for all columns. It would be fixed in upcoming version.

Meanwhile please use this patch to fix it

Code: [Select]
jQuery.paramquery.cToolPanel.prototype.getObj=function(t){var a={},e=this.that;return t.find(".pq-pivot-col").each((function(t,r){var u=r.dataset.di,o=e.getColumn({dataIndx:u}),n=r.getAttribute("type")||o.summaryDefault||e.iGroup.getAggOptions(o.dataType)[0];o.summaryDefault=a[u]=n})),a};

you may remove the custom code in pivotCM event related to it.

Pages: [1] 2 3 ... 427