sort grid : up and down arrow

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

sort grid : up and down arrow

Post by CAPL_INFO »

Hello,
We have a grid which sorted by the RPG programm with the grid property called "field name sort response". So we want to display an up and down arrow.
The on line documentation specified :
Image

...we don't understand how it's works...sorry.

Thanks for reply.
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: sort grid : up and down arrow

Post by matt.denninghoff »

The "field name sort response" property works for a grid that has fields in the columns--a Profound UI handler-driven grid. The grid would also be a paging grid. (If the grid loads all records at once, then the client-side code should be used to handle sorting.)

Suppose you bind "field name sort response" to a field named sortField. You also have a variable, say, prevSortField, which gets set to whatever the sorted field column is. After a user clicks a column to sort, then in RPG, sortField gets filled with the name of the field that is in the column that was clicked. When ExFmt returns control to your program, you'd check to see if sortField is different from prevSortField. If the two variables are different, then the sort column changed, and you'd update your sorting SQL as well as prevSortField. If the variables are the same, then you'd change the direction of the sorting. That is, if the sort direction was ascending, then you'd change your SQL to sort descending.

To get the arrows to display, you'd also need to bind to "default sort order" and "initial sort field". iconField below is a 25-character field. iconAscend is bound to an indicator:
iconAscend.png
iconAscend.png (35.33 KiB) Viewed 562 times
In RPG after ExFmt, you would set iconField to sortField when sortField is not empty. The "initial sort field", iconField , is what tells the grid which column to place the arrow in.

The "default sort order", iconAscend, tells the grid which direction to point the arrow. In RPG, iconAscend is used to determine if the SQL should sort Ascending or Descending. The value of iconAscend should toggle whenever the same sort column is clicked. If a different sort column is clicked, then you can set iconAscend On or Off, depending on how you want to start the sort, ascending or descending.
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

Grid selected row

Post by CAPL_INFO »

Hello,

Following the update of version 5.12, a line of code on a grid no longer works!
Via a Select List in a column of a grid, on the OnClick, I use javascript code to force activation of the selected line of the
  grid :

Image

Since the version 5.12, we have this error message on the click :

Image

Can you tell me what has changed on the Grids?
Thank you
cordially
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: sort grid : up and down arrow

Post by matt.denninghoff »

It looks like your code is referencing an obfuscated variable. In the version you were using, "w" was the name of the variable. In every release of Profound UI, that variable will have a different name.

Instead of using the obfuscated variable, it would be best to use the grid API functions to accomplish what you need. You might use "setDataValue" (http://www.profoundlogic.com/docs/pages ... d=26214527) to set the field.

If there are no grid API functions that accomplish what you need, then you can email support@profoundlogic.com and request an enhancement.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests