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 ... 7
1
Help for ParamQuery Pro / Re: Filter in header to stay focused after filter
« on: September 12, 2024, 12:43:06 am »
I know how to set it etc. which wasn't my question, I need to trigger the filter to start filtering, as the filters have already been set.

How do I trigger the filter to start programatically in the listner functions listed above?

2
Help for ParamQuery Pro / Re: Filter in header to stay focused after filter
« on: September 11, 2024, 12:47:39 am »
Quote
filter can be manually triggered on "Enter" by using column.filter.listener, name of event = "keydown/keyup" -> check event.key == "Enter" in the callback and call filter method manually in the listener callback.

How do I "call filter method manually in the listener callback"?  Besides using $("#grid").pqGrid("refresh") which does not work, how do I do it as there is no documentation?

filter:{
   crules:[{condition:"contain"}],
   listener: {
      "keydown": function(e, ui){
         if(e.key==="Enter")
            $("#grid").pqGrid("refreshDataAndView"); // <<<< Does not work and clears the filter
      },
      "timeout": function(){ $("#grid").pqGrid("refreshDataAndView"); } // <<<<< If I don't do something here, with "listner" set, it ignores the standard timeout function call
   }
}

P.S. Thanks for the focus hint.

3
Help for ParamQuery Pro / Re: Filter in header to stay focused after filter
« on: September 09, 2024, 09:30:36 pm »
I have looked and haven't traced a single refresh after a filter, but I think it is somewhere else due to virtual page scrolling.

I am using virtual scroll paging using a method I discussed before, where the grid is filled with the first page of data then blank rows for the data that hasn't yet loaded.  The "getData" method seems to be triggering the refresh, thus the change of focus when I return the data in "getData".

How can I re-focus the last selected filter when using "getData".

Also is it possible to trigger the filter when "ENTER" is pressed while typing in the filter input, as that way I could set a longer timeout that will terminated when the ENTER key is pressed?  For example, I set a 2 second time out, I enter the filter and press enter, the filter is triggered as I press enter and the timeout is obviously cancelled.

4
Help for ParamQuery Pro / Filter in header to stay focused after filter
« on: September 09, 2024, 03:36:52 pm »
I'm getting an issue with slow typers, as the filter starts as they are typing because they type really slow (I know I can change the timeout, but I don't want to set it to 5 seconds).  The filter starts but the next character they type isn't appended to the filter in the header.

The reason is that the header is refreshed after the data is loaded.

How can I set the focus to the "same" filter in the header after the load?  If this is not possible, please can this be a feature request.

5
👍

Please could you also give the option to put the values (as it does currently) or just the quantity cheked.

Also, do you have an ETA for the next version?

6
Help for ParamQuery Pro / How do I get the the current filter rules
« on: August 18, 2024, 01:12:37 am »
How do I get the current filter rules, including filters set by filters in the header column and programatically?  The same rules sent to the remote would be fine.

My gut feeling is to go through the column model and get the "filter.crules" for each column.

7
1) Thanks, you misunderstood about loading remotely, and I know a few ways, but I still have to use options and have a good reason for doing so (I wouldn't if I didn't have to).

2) I am still having trouble filling in the column header input/select with the quantity of how many options have been checked in the range, instead of just the comma string of numbers.  I have done:

Code: [Select]
dataIndx:"DEPOT",
filter: {
crules: [{condition:"range"}],
selectGridObj: function (ui) {
ui.obj.colModel[0].renderLabel = function(ui){ return ui["rowData"]["NAME"]; };
},
gridOptions: {
stripeRows: false,
numberCell: {show: false},
filterModel: {header: false},
},
options: [
{"DEPOT":1, "NAME":"London},
{"DEPOT":2, "NAME":"Manchester},
{"DEPOT":3, "NAME":"Birmingham},
{"DEPOT":4, "NAME":"Glasgow},
{"DEPOT":5, "NAME":"Leeds},
...
]
},...

What I want to accomplish is that on the column header in the input (that looks like a select), I want to make it blank if all or nothing selected, "[1]" if one option is selected, "[2]" if 2 options are selected, etc.  Also the filter might also be set programmatically and not just with the drop down select grid.

8
Have to use filter options as using paging and all the options might not load on the first page.

9
Bug Report / Please change one line of code in next version
« on: August 15, 2024, 12:55:33 am »
I think it is line 4490 from (inside fn.remoteRequest):

Code: [Select]
if (that.loading) {
to

Code: [Select]
if (that.loading && that.xhr && typeof(that.xhr)==="function") {
When I re-open a jquery UI dialog that contains a pqGrid and load it with new data I get the attached error.  The above code prevents that.

Also another different issue is to do with jQuery UI.  If the grid is in a MODAL jquery UI dialog and a grid filter shows a popup grid for filter options, if that popup has an input filter, it won't work and you can't type anything into it.  This is due to the jQuery UI screen mask that disables all keyboard and mouse events from going through it.  As the popup is attached to the body which is below the mask (z-index doesn't count), it doesn't get the keyboard events as they are stopped by the mask.  To overcome this I suggest making popup's parent the grid element (which is above the mask) and not the document body.

If you reply with jsFiddle template I'll build all the examples for you.

10
How do I insert the code and what event do I need to listen to?

Please note that before the grid opens, some filters are preset programatically before the data is fetched.

11
Bug Report / Re: On range filter with options getting a console error
« on: August 14, 2024, 11:37:10 pm »
Starngest thing, when I do:

gridOptions: {
   ...
   check: function(e, ui){},
   ...
}

The error goes away, but nothing happens when I select an option

Do you have a jsFiddle or Stackblitz template link?

12
Bug Report / Super minor bug on export to xlsx
« on: August 14, 2024, 08:21:01 pm »
So minor, barely worth reporting, but best to get it perfect:

Code: [Select]
eachCell: function(cell, ci, ri, column, rowData)
{
....
cell["format"] = "dd/mm/yyyy hh:mm";
}

When I open Excel, the cells have a custom format as 'dd\/mm\/yyyy hh:mm' and not 'dd/mm/yyyy hh:mm'

It all works fine, it's just the escape character should not be included.

13
Bug Report / On range filter with options getting a console error
« on: August 14, 2024, 07:36:09 pm »
It actually all works fine but there shouldn't be an error in the console.  Using remote data, when I select an option in the grid dropdown I get the attached error.

Code: [Select]
colModel: [...
{dataIndx:"DEPOT", width:100, halign:"center", title:"Depot",
filter: {
crules: [{condition:"range"}],
conditionList: ["range"],
options : [{"1":"London"}, {"2":"Manchester"}, {"3":"Birmingham"}],
gridOptions: {
stripeRows: false,
numberCell: {show: false},
filterModel: {header: false}
}
}
},
...]

I know I am filtering using integers, which is fine as that is what my server wants and this is remote data, so local ignores it

Code: [Select]
[
{"DEPOT":"London", ....},
{"DEPOT":"London", ....},
{"DEPOT":"Manchester", ....},
{"DEPOT":"London", ....},
{"DEPOT":"Birmingham", ....}
]

The error according to the console the error is here:

Code: [Select]
_pq._trigger = function(type, evt, data) {
var self = this,
prop, orig, this_listeners = self.listeners,
listeners = this_listeners[type],
o = self.options,
allEvents = o.allEvents,
bubble = o.bubble,
$ele = self.element,
callback = o[type];
data = data || {};
evt = $.Event(evt);
evt.type = self.widgetName + ":" + type;
evt.target = $ele[0];       // <<<<<<<<<<<<<<<---------- THIS LINE
orig = evt.originalEvent;
if (orig) {
for (prop in orig) {
if (!(prop in evt)) {
evt[prop] = orig[prop]
}
}
}
if (allEvents) {
if (pq.isFn(allEvents)) {
allEvents.call(self, evt, data)
}
}
if (listeners && listeners.length) {
handleListeners(self, listeners, evt, data);
if (evt.isImmediatePropagationStopped()) {
return !evt.isDefaultPrevented()
}
}
if (o.trigger) {
$ele[bubble ? "trigger" : "triggerHandler"](evt, data);
if (evt.isImmediatePropagationStopped()) {
return !evt.isDefaultPrevented()
}
}
if (callback) {
var ret = callback.call(self, evt, data);
if (ret === false) {
evt.preventDefault();
evt.stopPropagation()
}
}
listeners = this_listeners[type + "Done"];
if (listeners && listeners.length) {
handleListeners(self, listeners, evt, data)
}
return !evt.isDefaultPrevented()
};

14
Using "render" and "diExtra" doesn't work as I am setting the rows with "options"

I actually thought instead of showing the names, could it show how many are selected or blank for none?

15
{dataIndx:"DEPOT_ID", title:"Name",
   render: function(ui){ ... returns name from ID.... }, 
   filter: {
      crules: [{condition:"range"}],
      conditionList: ["range"],
      options : [{"1":"London"}, {"2":"Manchester"}, {"3":"Birmingham"}],
      gridOptions: {
         stripeRows: false,
         numberCell: {show: false},
         filterModel: {header: false}
      }
   }
},

My grid displays depots, however depots are based on a unique ID on my server.  The NAME field is just a string and is not necessarily unique.  If I want to select a depot, the server wants the DEPOT_ID integer field and not the NAME field.

Basically I want the drop down to display the NAME but return return the DEPOT_ID to the server for filtering, so I add

Code: [Select]
filter.options : [{"1":"London"}, {"2":"Manchester"}, {"3":"Birmingham"}],
Only issue is that in the "filter box" on the header displays the DEPOT_ID numbers and not the NAME strings.  How do I fix this?

Also, how do I add "children" for each depot option so it's a pivot grid or tree, so under "London" I want to list each London sub depot name?  I want to select just a sub depot without selecting London or I want to select London, other depots and maybe a few sub depots:

✓ London
      Sub 1
   ✓ Sub 2
      Sub 3
   Manchester
   ✓ Sub 4
      Sub 5
   Birmingham

OR

   London
     ✓ Sub 1
     ✓ Sub 2
        Sub 3
✓ Manchester
        Sub 4
        Sub 5
✓ Birmingham

To do above my get out of jail option is just to add some "&nbsp;" before each Sub in the NAME and stick with a flat list.  Is there a cleaner and better way?

Pages: [1] 2 3 ... 7