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
Here is a demo of jsTree and how they do it which more subtle and I feel is better: https://preview.keenthemes.com/html/keen/docs/general/jstree/dragdrop

2
Is there any news on this.  Most others do as follows:
  • Dropping inside the row near the vertical middle makes it a child. The arrow drop indicator on recieving row indented right inside the row to signify drop position is a child
  • Dropping near the to the top or bottom of the recieving row makes it a sibling The indicator arrow on top or bottom of the recieving row to signify drop position is a sibling
  • Optional callback function that returns false if drop not allowed (like a hover_node event).  No drop allowed gives the cross just like pqGrid already does (would be nice to be able to change this, maybe make it red and the check green)
  • Option if row can accept dropped children, if false then drop arrow indicator only shows sibling dropping, even if cursor is near center of the row.

Will this be in the next version and do you have a release date yet of the next version?

This one does it quite nicely and is far easier for the user to understand https://mbraak.github.io/jqTree/examples/03_drag_and_drop/

3
At the moment the only way to do it is in colModel.render:

Code: [Select]
render: function(ui){
return {
text: ui["cellData"], // This is not needed, included here for clarity
attr: 'title="'+ui["cellData"].replace('"',""")+'"'
}
}

When the column is narrow and the value is trimmed (if not multiline), the value is cut off, so hovering over to show the full value in the popup is nice for the user.

Also it would be nice to also be able to pass the attr as an object like:

attr: {
   "title": "Some message > this message & another bad char",
   "data-temp": "Some data variable"
}

EDIT: YOU CAN MAKE ATTR AN OBJECT.  I isn't mentioned in the API guide.


4
Suggest new features / Add a resized event
« on: February 23, 2025, 04:18:31 am »
When the grid resizes, depending on your options like flex, etc, columns and rows get resized and or added to fit inside the grid.

It would be nice to have an event that is fired once all the resizing and render alterations have finished.

5
I have added this with a resize observer, but it would be better to have this as a feature:

Code: [Select]
new ResizeObserver(function(){ setTimeout(function(){ grid_resize(); }, 100); }).observe( $("#grid")[0] );
...
function grid_resize()
{
if($("#grid").is(":visible"))
{
// Do we add horizontal scroll
var width = 0;
$("#grid").pqGrid("Columns").each(function(col){
if(!col.hidden)
width += intval(col["width"]);
});

// Do we hide or show the scroll bar
$("#grid").pqGrid("option", "scrollModel", {autoFit:width<$("#grid").width() ? true : false});
}
}

6
Help for ParamQuery Pro / Re: Horizontal scroll bar scrollModel issue
« on: February 11, 2025, 05:09:19 am »
Just to help others, I accomplished this by doing the following:

Code: [Select]
new ResizeObserver(function(){ grid_resize(); }).observe( grid );

grid_resize()
{
if(grid && grid.is(":visible"))
{
// Do we add horizontal scroll
var width = 0;
grid.pqGrid("Columns").each(function(col){
if(!col.hidden)
width += intval(col["width"]);
});

// Do we hide or show the scroll bar
grid.pqGrid("option", "scrollModel", {autoFit:width<grid.width() ? true : false});
}
}

7
Thanks. Can't believe I missed that.

8
I have a grid with dataModel.location="remote"

Just on the first load (one off when data loaded for the first time only) I want to set an initial filter on a column.  So when refresh, add/remove filters, etc. it must NOT revert to the initial filter option.

I want to avoid calling the remote server twice.

After building the table, I have tried making the dataModel.location="local", applying the filter then dataModel.location="remote" which works, but is there a cleaner way to set the initial filter in "options"?

I have tried using grid.one like below, however this calls the remote server to load the data twice, being one time to load the initial data (unfiltered) then again after the "one" is called with a new filter.

Code: [Select]
grid.one("load", function (evt, ui) {
// Apply initial filtering.
grid.filter({
oper: "add",
rules: [
{ dataIndx: "DEPOT", value: ["London"] },
]
});
});

9
Help for ParamQuery Pro / Do not show the message "No rows to display"
« on: January 19, 2025, 02:16:47 am »
When a grid has no data, I want to hide the text "No rows to display" that appears in some grids.  How do I do this withou changing the locale files as I don't want to do this for all grids?

10
Help for ParamQuery Pro / Re: Inheritance for cVirtual
« on: January 13, 2025, 11:33:29 pm »
Please can you respond to this support request

11
Help for ParamQuery Pro / Inheritance for cVirtual
« on: January 03, 2025, 07:27:21 pm »
I want to override functions calcTopBottom, getTop, getLeft, etc. which is in  window.pq.cVirtual.

I am using the jQuery version of pqGid, so to overwrite some functions I use the following which works fine:

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);

However when I want to override cVirtual functions, to test this I do the following:

Code: [Select]
var cVirtual = window.pq.cVirtual.prototype;
cVirtual.calcTopBottom = function(left) {
console.log("calcTopBottom");
// Call the old
return cVirtual.calcTopBottom(left);
};
cVirtual.getTop = function(ri, actual) {
console.log("getTop");
// Call the old
return cVirtual.getTop(ri, actual);
};
cVirtual.getLeft = function(ci, actual) {
console.log("getLeft");
// Call the old
return cVirtual.getLeft(ci, actual);
};
cVirtual.getHeightR = function(ri, rows) {
console.log("getHeightR");
// Call the old
return cVirtual.getHeightR(ri, rows);
};
cVirtual.calInitFinal = function(top, bottom, left) {
console.log("calInitFinal");
// Call the old
return cVirtual.calInitFinal(top, bottom, left);
};

However the above functions are never called.  What am I doing wrong?

12
Bug Report / Another bug for hidden grids (with fix)
« on: January 03, 2025, 06:05:19 pm »
If the grid is hidden when data is loaded, to fix I added the following:

Code: [Select]
getHeightR: function(ri, rows) {
if(typeof(ri)==="undefined") return 0;
...

getHeightCell: function(ri, rows) {
if(typeof(ri)==="undefined" || ri<0) return 0;

In the case above, I opened the grid, scrolled down a lot, closed the grid, new data was loaded and it went wrong trying to show it.

The pqGrid code has been written assuming that the grid is visible when data is loaded or a refresh is called.  This is obviously not always the case as sometimes the grid is prepared in the background for a better user experience.

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

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

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

Pages: [1] 2 3 ... 10