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 ... 10
1
Suggest new features / Re: Quick and simple documentation request
« on: December 03, 2024, 07:54:21 pm »
Please could you do this on the demos page as well (https://paramquery.com/pro/demos) as once I select a demo, the title bar scrolls off here as well.

2
Bug Report / Touch/hover style bug
« on: November 25, 2024, 08:02:54 pm »
This is a minor bug

When the option below is set:

selectionModel: { type:"row", mode:"single", column:false, all:false, toggle:false},

when you touch and move away from a row (like slide or roll your finger on the screen) but not select the row, the hover highlight stays on the row (see attached image) so eventually you end up with lots of rows highlighted.  This is the same on iPhone and Android.

3
Bug Report / Re: Safari 16 and below bug with suggested fix
« on: November 25, 2024, 07:58:26 pm »
Just to add, this is serious as v10.1.0 will not load on Safari 16 or below because of this.

4
Bug Report / Safari 16 and below bug with suggested fix
« on: November 25, 2024, 06:15:50 pm »
In pqgrid.dev.js from 3212:

Code: [Select]
/*BUG*/
//fmtPart = fmtPart.replace(/(?<![ap])m{1,5}/gi, replacer("M"));
/*SUGGESTED FIX*/
fmtPart = fmtPart.replace(/(?:^|[^ap])m{1,5}/gi, function (match, offset, string) {
// Ensure the match doesn't follow 'a' or 'p'
if (offset === 0 || !/[ap]/i.test(string[offset - 1])) {
return replacer("M")(match);
}
return match;
});

Safari 16 does not accept the regex "/(?<![ap])m{1,5}/gi" because it does not support "<"

Please confirm the suggested fix is OK, if not, please tell me what it should be replaced with.

5
Bug Report / Re: Listener bug in v10.1.0
« on: November 20, 2024, 07:36:09 pm »
Also just to mention, if I just set the "keydown" listener, the "timeout" normal course of things stops being triggered

6
Bug Report / Re: Listener bug in v10.1.0
« on: November 20, 2024, 03:58:22 pm »
Thanks for adding this, I have removed all of the code.

However I feel it is my duty to still report there is still a bug there.  I added the listener code as this:

var listener = {
   "keydown": function(e, ui)
   {
      console.log("keydown", e);
   },
   "timeout": function(e, ui){
      console.log("timeout",e);
   }
};

When I typed the name "David" (no [Enter] key pressed) I got the attached result.  As you can see, timeout is getting called for keydown events, sometimes it is the other way round.

7
Bug Report / Listener bug in v10.1.0
« on: November 19, 2024, 11:59:46 pm »
I had a listener that previously worked.  The idea of the listener is that the filter starts either when the [ENTER] key is pressed or the timeout happens. v10.0.0 and below worked fine, v10.0.1 now has an issue, in that every keypress, the filter starts due to the timeout.

If I comment out the "timeout", it works fine except the timeout is never triggered.  If I include the timeout, it goes all wrong.

Ideally I would like to avoid using the "do_filter" function and just use the default filter start trigger, but I don't know how to call that.

Code: [Select]
var text_listener = {
"keydown": function(e, ui)
{
if(e.key==="Enter")
do_filter(ui);
},
// If I comment out below for v10.0.1 there are no wrong filter triggers
"timeout": function(e, ui){
do_filter(ui);
}
};

function do_filter(ui)
{
var rule = { condition: ui.column.filter.crules[0].condition,  dataIndx: ui.column.dataIndx, value: ui.value, value2: ui.value2 },
CM = $("#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)
$("#grid").pqGrid("filter", {
oper: "add",
rules: [
rule
]
});
}

...

columnModel = [
{dataIndx:"NAME", title:"NAME", filter:{crules:[{condition:"contain"}], style:"text-align:"+dir, listener:text_listener}},
...
];

Doing a console log I found the bug.  The timeout in the listener is getting the "keydown" event and not getting the "timeout" event.   I commented out the "keydown" listener and timeout worked.

I tried below, but either keydown or timeout get missed:

Code: [Select]
var text_listener = {
"keydown": function(e, ui)
{
if(e.type==="keydown" && e.key==="Enter")
do_filter(ui);
},
// If I comment out below for v10.0.1 there are no wrong filter triggers
"timeout": function(e, ui){
if(e.type==="timeout")
do_filter(ui);
}
};

I shouldn't have to test for the event as that function should never be called for a different event.

8
Bug Report / Tiny bug in v10.0.1
« on: November 19, 2024, 09:27:14 pm »
If the grid is created inside a hiden parent (parent hidden before grid created, like a jquery UI dialog), errors occure unless the following code is added:

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

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

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

9
Suggest new features / Re: Quick and simple documentation request
« on: November 19, 2024, 07:41:45 pm »
 :) Thank you for doing this.  It's the little things that make things great.

10
I spotted this on a mobile when I turned it to portrait.

My page has a bunch of text and images then the grid on the bottom of the page.  My grid has minimum height, so turning portrait might mean the lower rows are off the screen and a screen (not grid) scroll up needed to show the rest of the grid. 

ISSUE: I load the screen portrait and due to the height of my top section, I can only see the top row of my grid. When I do a page scroll (not grid scroll), the rows that were off screen are blank, unless I refresh or even do a grid scroll then the rows appear.

I'll try and get a demo up tomorrow.

11
On the column filter when it is a single line text, add an "X" or make it type="search" instead of type="text".

I tried making them type="search", however when clicking the "X" it doesn't trigger the filter.

12
Suggest new features / Re: Quick and simple documentation request
« on: October 30, 2024, 03:36:25 pm »
Sorry, misseed the top bit

Code: [Select]
<nav class="navbar navbar-default" style="position:sticky; top:0;">
Adding 'style="position:sticky; top:0;"' also looks better and doesn't leave the blank space above "+ Options"

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

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

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

Pages: [1] 2 3 ... 10