Page 1 of 1

scrollbar position WITH filter

Posted: Wed Jan 27, 2021 12:05 pm
by dpkenny
Does anybody know how to position the scrollbar WITH filter (right click column and click filter)? It works fine unfiltered and even works fine sorted on any column but does NOT work if filtered.

I have a hidden field called "rowNo" and onrowclick event "changeElementValue('rowNo', row);"
My RPG program moves "rowNo" to SFLREC and the EXFMT the screen. Subfile record number is specified on the subfile screen with bound field SFLREC.
Like I said, it works fine until filtering the subfile.

Re: scrollbar position WITH filter

Posted: Wed Jan 27, 2021 3:52 pm
by Scott Klement
Hi Kenny,

Sorry to hear that you are having problems getting things to work. I'm not completely sure that I understand what's happening in your scenario?

Each time you use EXFMT it completely wipes out the screen and re-draws it. After it does that, it will position to the row you specified in the "subfile record number" property.

You say this doesn't work with a filter... and this is where I'm getting lost. The filter should've been completely wiped out when you did EXFMT. How are you re-enabling it? Are you using the persist state property to remember the filter and re-apply it each time the screen is re-drawn? Or are you using the filter APIs? Or is this a database-driven grid?

Re: scrollbar position WITH filter

Posted: Wed Jan 27, 2021 4:14 pm
by dpkenny
Yes, using persist state property
Not using filter API, just right click and filter column
Not a database-driven grid, load a subfile from RPG

Probably has something to do with the RRN it returns versus the number of records showing on the screen when filtered.
Strange thing is it works fine when sorting on a column which totally re-sequence the RRN (click on 5th record down, may be RRN 289 but still moves to the top and the rest remain in sorted sequence.

Re: scrollbar position WITH filter

Posted: Thu Jan 28, 2021 3:22 pm
by dpkenny
So, I found a work around.
I put "changeElementValue('Filter1', getObj("Grid1").grid.getFilter(1));" in the "onfilterchange" event.
Then made my RPG program that loads the subfile duplicate the filter so only filtered records are loaded.

Seems to work, BUT, I need to automatically do an enter (pui.click) after the filter is keyed.
Currently, I have to hit enter twice, once to get out of the filter box, and once again for the subfile refresh.

Any ideas?

Re: scrollbar position WITH filter

Posted: Fri Jan 29, 2021 1:03 pm
by dpkenny
I didn't use "filter response" because the documentation says "This should be used only for page-at-a-time grids, not for database-driven grids nor for load-all grids."

I decided to try it anyway on my load-all grid and it seems to be working fine!
Does anybody know what I should be looking out for as to why it should NOT be used on load-all grids?