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

Pages: 1 [2] 3 4 ... 10
16
Suggest new features / Re: In Render allow jQuery object to be returned
« on: October 29, 2024, 11:22:26 pm »
I might want to return something like:

Code: [Select]
var  that=this,
      jq = $("<span>", {html"O"})
   .click(function(e){ that.do_something(this); })
   .data("dta", {"id":2, "name":"O"})
   .add(
       $("<span>", {html"X"})
       .click(function(e){ that.do_something_else(this); })
       .data("dta", {"id":2, "name":"O"})
   );

return {jquery: jq};

I can't do above passing HTML.

17
The listeners work (I have made them work), and I have done them, but an option would be easier and would 100% work on new versions.

I also had to write the code below to prevent from doing 2 remote calls for the same filter, the second being triggered by the timeout:

Code: [Select]
var rule = { condition: ui.column.filter.crules[0].condition,  dataIndx: ui.column.dataIndx, value: ui.value, value2: ui.value2 },
CM = this.grid.pqGrid("getColModel");

// Check if the filter is not already applied
for(var i=0, len = CM.length; i < len; i++){
// If there is no change
if( CM[i]["dataIndx"]===ui.column.dataIndx && ui.value===CM[i]["filter"]["crules"][0]["value"] && ui.value2===CM[i]["filter"]["crules"][0]["value2"] )
rule = null;
}

// If we have a rule, apply it
if(rule)
this.grid.pqGrid("filter", {
oper: "add",
rules: [
rule
]
});

The issue is that with new versions, the above might end up not being compatible.

Also you promised to add the "X" in the column input filter to clear the text.  When you do this, my code might end up being incompatible.

18
Suggest new features / Re: Customise the "showLoading"
« on: October 29, 2024, 11:05:57 pm »
My current way of doing it is:

Code: [Select]
(function($) {
var fn = $.paramquery._pqGrid.prototype;
fn.showLoading = function() {
if(this.$grid_center.is(":visible"))
{
this.loading = true;
open_loading_overlay();
}
};
fn.hideLoading = function() {
this.loading = false;
close_loading_overlay();
};
})(jQuery);

It's not an issue to do above, but an easier way would be nice and it would be standard across versions.

19
Bug Report / Re: Please change one line of code in next version
« on: October 29, 2024, 11:01:03 pm »
If you need the code:

Code: [Select]
$("#grid").pqGrid("showLoading").pqGrid("refreshDataAndView");

20
Bug Report / Re: Please change one line of code in next version
« on: October 29, 2024, 06:44:41 am »
Found the bug.  It is caused by calling "showLoading" before loading remote data.

The issue is that this.loading is true, but at this point there is no XHR, thus the bug and the reason the fix works.

21
Bug Report / Re: BUG v.10.0.0 filter.title
« on: October 29, 2024, 06:32:29 am »
Tried this but no success on the error

https://jsfiddle.net/v0418zyj/3/

22
Bug Report / Re: Another v10.0.0 bug with fix
« on: October 29, 2024, 06:06:54 am »
Found out how to get the bug

https://jsfiddle.net/v0418zyj/1/

Before you click the show button, open the browser console then resize the screen.  You will see the error:

Uncaught TypeError: Cannot read properties of undefined (reading 'htContClient')

To fix this and other similar ones when the grid is hidden:


Code: [Select]
calcTopBottom: function(left) {
if(typeof(this.dims)==="undefined") return 0;
...

getTop: function(ri, actual) {
var top = this.topArr ? this.topArr[ri] : 0,
...

getLeft: function(_ci, actual) {
if(typeof(this.leftArr)==="undefined") return 0;
...

23
It's due to a Chrome bug when the keyboard pops up the screen resizes a few times https://issues.chromium.org/issues/40924170.

When you select the column filter, the screen resizes and if the grid is getting refreshed on a resize, the header is re-drawn and the focused input is then unfocused, and as a new column header is then created, it obviously doesn't have the focus.

Solutions could be to put the grid in a div and make grid width and height 100% of the parent, then when the screen resizes, resize the div, not the grid.

24
Help for ParamQuery Pro / Re: Override "showLoading"
« on: October 26, 2024, 06:17:51 pm »
I modified the functions slightly due to a "bug"

Code: [Select]
(function($) {
var fn = $.paramquery._pqGrid.prototype;
fn.showLoading = function() {
//console.log("showLoading", this);
if(this.$grid_center.is(":visible"))
{
this.loading = true;
open_loading_overlay();
}
};
fn.hideLoading = function() {
//console.log("hideLoading");
this.loading = false;
close_loading_overlay();
};
})(jQuery);

If the grid is hidden and the screen size changes, for some reason "showLoading" was getting called, so I had to add the "if" statement.

25
Help for ParamQuery Pro / Override "showLoading"
« on: October 26, 2024, 12:00:14 am »
I want to override showLoading and hideLoading for all pqGrids that I define after I call below.  Is the following correct?

Code: [Select]
var fn = $.paramquery._pqGrid.prototype;
fn.showLoading = function() {
console.log("showLoading");
this.loading = true;
open_loading_overlay();
};
fn.hideLoading = function() {
console.log("hideLoading");
this.loading = false;
close_loading_overlay();
};

26
Suggest new features / Quick and simple documentation request
« on: October 25, 2024, 09:09:30 pm »
On the https://paramquery.com/pro/api page (and probably all others), please can you change the top nav bar code to:

<nav class="navbar navbar-default" style="position:sticky;">

This enables me to jump to other pages (like demo pages) when I'm looking at documentation instead of having to scroll to the top every time.

27
Suggest new features / Customise the "showLoading"
« on: October 25, 2024, 08:30:57 pm »
An option to customise the "Loading".

I would suggest being able to set classes, content and style, overriding the default or alternatively not having the default and calling our own function

For us we just want a specific spinning SVG that is a CSS class, wirth no words.  We also need to mask the entire page, not just the grid.

Also, if we could have a way of hiding the standard "Loading" and showing our own.  Sometimes while data is loading, we need to mask the entire page and do other things.  For this we would need a showLoader event and hideLoader event

28
Bug Report / Re: Another v10.0.0 bug with fix
« on: October 21, 2024, 11:34:05 pm »
Found the issue, it is the height parameter.  Does not work if "100% - 2", but it does for "100%".  It is supposed to work with both.  The 2 allows for the extra pixels taken up by the border.

https://jsfiddle.net/jplevene/xa615pn7/5/

Used your source for v10.0.0 and it worked.  Have to find what my grid did that caused the issue (https://jsfiddle.net/jplevene/xa615pn7/9/)

My fix just makes sure that "this.topArr" is set instead of causing a crash which happens when it is undefined, and for some reason in what is my very complex grid, it is not. (I tried to simplify the grid in my examples)

29
Bug Report / Re: Another v10.0.0 bug with fix
« on: October 21, 2024, 10:49:01 pm »
I did this in a few minutes.  It doesn't show all the bugs, but you get the drift

https://jsfiddle.net/jplevene/xa615pn7/

refreshDataAndView does not refresh if the view by establishing new widths and heights if it was previously hidden

30
Bug Report / Another v10.0.0 bug with fix
« on: October 21, 2024, 08:12:06 pm »
When a grid is displayed inside a hidden div like a dialog, tab, accordian, etc, there is a bug on line 28717

Code: [Select]
var top = this.topArr[ri],
Changing it to below fixes it:

Code: [Select]
var top = this.topArr ? this.topArr[ri] : 0,

Pages: 1 [2] 3 4 ... 10