PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Jeffrey Ferreira on June 06, 2024, 07:44:00 PM

Title: Sort On Header Click / Row Height
Post by: Jeffrey Ferreira on June 06, 2024, 07:44:00 PM
Hello,

I sometimes make custom queries where as the user types into a multi-line I hide rows via the RowHeight property to zero for those rows that don't meet search criteria. Customers seem to really like it, the only problem is when they ask me to enable 'SortOnHdrClick.

If i filter rows via the row height then if they click a column it just messes it up.
is there a way i can do both / hide rows and still have sort on header click enabled

jeff
Title: Re: Sort On Header Click / Row Height
Post by: Jane Raymond on June 07, 2024, 10:53:33 AM
If you just want to display the records whose keys start with the value of the multiline, I have an alternate way to do this that doesn't require any coding. It involves using the smart control feature.
Title: Re: Sort On Header Click / Row Height
Post by: Jeffrey Ferreira on June 07, 2024, 11:02:57 AM
Hi Jane,

So the problem that usually brings about these queries is the Customer, Vendor Name would be something like this:
Mast Road and Grain
and they want to search for Grain

This is my conundrum. The pxplus standard queries work fine when using the keys and typing in first few letters of key.

this is more like a key word search thru the entire row of data.

maybe there is no solution for this - i have coded around it before by checking to see if they clicked on Row -1 and executing Sort Logic myself but i was trying to avoid.

jeff
Title: Re: Sort On Header Click / Row Height
Post by: Jane Raymond on June 07, 2024, 02:30:57 PM
Got it.
Take your querylist definition and change the Filter. Remove the Prefix settings and instead create a Test in the Selection Logic, something like:


Test:
YOURVAR$="" OR POS(UCS(YOURVAR$)=UCS(REC(_MWR_IOL$)))>0


This test will print the entire list if YOURVAR is blank, and if it's not it will look for the value in the data for the row which is found in REC(_MWR_IOL$).


REC(_MWR_IOL$) is somewhat esoteric, but looks like a value that would be useful for tests like this, so I'll create a new query variable containing its value for the next release.
Title: Re: Sort On Header Click / Row Height
Post by: Jeffrey Ferreira on June 07, 2024, 02:34:25 PM
I will give that a try Jane. Thank you.
Title: Re: Sort On Header Click / Row Height
Post by: Jane Raymond on June 18, 2024, 09:38:28 AM
Further on using REC(_MWR_IOL$), the result could contain some color mnemonics and/or additional fields, so for the next release I've added a special QUERY_ROW$ variable that contains just the current contents of a row with the mnemonics stripped. It can be used in selection criteria or as a return value.