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
Though it doesn't make sense why would you do that.

you can enable save button by getting DOM reference to it and calling disabled false.

Code: [Select]
$( selector of save button ).button("option", "disabled", false );

2
This patch can be used to fix the issue.

Code: [Select]
var p=jQuery.paramquery.cDragColumns.prototype;jQuery.paramquery.cDragColumns=function(e){var r,o,t=this,a=e.options,n=a.dragColumns||{},d=function(r,o){return $("<div class='pq-arrow-"+r+" ui-icon "+o+"'></div>").appendTo(e.$grid_center)};t.that=e,t.rtl=a.rtl,t.status="stop",t.$arrowTop=d("down",n.topIcon),t.$arrowBottom=d("up",n.bottomIcon),t.hideArrows(),n.enabled&&e.$head_i.draggable({distance:5,cursorAt:{top:-10,left:-10},cancel:".pq-grid-header-search-row,input,textarea,button,select,option,.pq-grid-number-cell",zIndex:"1000",appendTo:"body",revert:t.revert.bind(t),helper:function(o,a){var n=o.target.closest(".pq-grid-col");if(n){var d,c=t.colIndicesDrag=e.getHeadIndices(n),i=t.columnDrag=c.column,l=i.parent,p=e.options.dragColumns.rejectIcon,s=e.getScale();return r=pq.getScale(document.body),!i||i.nodrag||i._nodrag||l&&1==l.colSpan||i.empty||!1===e._trigger("columnDrag",o,{column:i})?"<span/>":(e.$head_i.find(".pq-grid-col-resize-handle").hide(),(d=t.$helper=$("<div class='pq-col-drag-helper pq-theme pq-grid-cell' data-di="+i.dataIndx+" ><div><span class='pq-drag-icon ui-icon "+p+"'></span>"+i.pq_title+"</div></div>")).css({scale:s[0]/r[0]+" "+s[1]/r[1]}),d[0])}return $("<div></div>")},start:function(){},drag:function(a,n){if(t.$helper){t.status="drag";var d,c=n.position,i=a.originalEvent,l=(i&&i.target!=document?i.target:a.target).closest(".pq-grid-col"),p=t.colIndicesDrag,s=p.ri,g=p.column,u=g.leftPos,h=u+g.o_colspan;if(c.left=c.left/r[0],c.top=c.top/r[1],console.log("cDragColumn.js td = ",l),l&&!l.closest(".pq-grid-header-search-row")&&e.evtBelongs(i)){var m=e.getHeadIndices(l),v=m.column,f=m.ri,q=m.colIndx;if(!(v.empty||v==g||v.nodrop||v._nodrop||s<f&&q>=u&&q<h))return o=l,t.colIndicesDrop=m,void t.onDrag(a,l);o!=l&&t.updateDragHelper(!1),o=l}else t.hideArrows(),d=$(".ui-droppable-hover",e.$top),console.log("cGroup.js $group = ",d[0]),t.updateDragHelper(!!d[0]);t.colIndicesDrop=null}},stop:function(r){if(t.status="stop",t.$helper){t.hideArrows();var o=t.colIndicesDrop;e.$head_i.find(".pq-grid-col-resize-handle").show(),o&&t.onDrop(t.colIndicesDrag,o,r)}}})},jQuery.paramquery.cDragColumns.prototype=p;

3
There is a problem in the way you have made changes in rowData directly and passed updated rowData to newRow parameter of updateRow method.

Code: [Select]
activeGrid.updateRow({
                rowIndx: ui.rowIndx,
                newRow: rowData, //pass new object here instead of rowData, and don't make any changes in rowData
                track: true,
                history: false,
                checkEditable: false,
                refresh: false
            });


newRow is supposed to be a new object containing only the changes in the fields you want.

4
Thanks for reporting the issue.

Handle is supposed to update its state according to its position above the column. It seems like a bug. I would provide the patch if feasible. It would be fixed in upcoming version if not patchable.

5
Help for ParamQuery Pro / Re: Icon in column header
« on: June 19, 2025, 07:31:32 pm »
Code example of adding icon using DOM manipulation:

Code: [Select]
refreshHeader: function(evt, ui) {
var $headerCell = this.getCellHeader({ colIndx: 0 });
var $title = $headerCell.find('.pq-title-span');
// Prevent duplicate icons
if ($headerCell.find('.ui-icon-disk').length === 0) {
$("<span class='ui-icon ui-icon-disk'></span>").insertAfter($title);
}
},

6
Help for ParamQuery Pro / Re: Icon in column header
« on: June 19, 2025, 07:15:04 pm »
Another method:

Add class to the header cell:

Code: [Select]
{ title: "ShipCountry", width: 100, dataIndx: "ShipCountry", clsHead: 'icon-class' },

Use css ::before or ::after pseduo-element

Code: [Select]
<style>
.icon-class .pq-title-span::after{
  display: inline-block;
  font-family: bootstrap-icons !important; 
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: -.125em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size:14px; 
  content: "\f214"; /* Unicode for calendar icon in Bootstrap Icons, replace with ucincode of your choice */
margin-left: 10px;
}
</style>

or use emoji

Code: [Select]
.icon-class .pq-title-span::after{
  content: "✂️";
  margin-right: 5px;
}

7
1st issue:

ParamQuery Pro supports xlsx format only, so please ensure to name the file with xlsx extension while downloading the file.


2nd issue:

Please add this refresh event in the grid initialization object. It would ensure to clear all the merged cells except the 1st cell in merged cell range, whenever any range of cells is merged in ParamQuery grid.

Code: [Select]
                refresh(){                   
                    var mc = this.options.mergeCells,
                        mcLast = mc.at(-1);
                    if( mcLast ){
                        //debugger;
                        let {r1, c1, r2, c2, rc, cc, cleared} = mcLast,
                            count = rc * cc;
                        if(count > 1 && !cleared){
                            let val = this.Range({r1, c1}).value()[0],
                                r = this.Range({r1, c1: c1, r2, c2});

                            mcLast.cleared = true;
                            this.one('beforeValidate', (evt, ui) => {ui.history = false});
                            r.value([val]);                           
                        }
                    }
                },

9
Help for ParamQuery Pro / Re: Icon in column header
« on: June 18, 2025, 06:40:35 pm »
If you don't want it to be part of title API, then

In refreshHeader event, get a reference to header cell with getCellHeader method

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

and add icon by DOM manipulation.

10
Help for ParamQuery Pro / Re: BootStrap Dropdown not working
« on: May 29, 2025, 06:50:13 pm »
grid cells have overflow: hidden; that's why the dropdown gets clipped.

It can be resolved by:

a) Either add style overflow: visible to the cells containing bootstrap dropdowns.

b) or add data-bs-popper-config='{"strategy":"fixed"}' to data-bs-toggle='dropdown' elements:

jsfiddle with 2nd solution:

https://jsfiddle.net/zyhcok5p/

More discussion about this issue:

https://stackoverflow.com/questions/31829312/bootstrap-dropdown-clipped-by-overflowhidden-container-how-to-change-the-conta

11
Bug Report / Re: Safari 16 and below bug with suggested fix
« on: May 28, 2025, 08:44:13 am »
The original code uses a negative lookbehind

Code: [Select]
fmtPart = fmtPart.replace(/(?<![ap])m{1,5}/gi, replacer("M"));.

The following snippet can be used instead, as it avoids lookbehind by capturing the preceding character:

Code: [Select]
fmtPart = fmtPart.replace(/(^|[^ap])(m{1,5})/gi, (match, prefix, mSequence, offset) => {
     return prefix + replacer('M')(mSequence, offset + prefix.length );
});

12
Please pass the params correctly

Code: [Select]
        grid.updateRow({
            track: false,
            history: false,
            checkEditable: false,
            refresh: true,
            rowList: [{
              rowIndx: ri,
              newRow: res.data
            }]
        });

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

14
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

15
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

Pages: [1] 2 3 ... 427