Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Sorting option in Maintain Read/Write Grid

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Sorting option in Maintain Read/Write Grid
 Login/Join
 
Guru
posted
Hi All,
Is there any way to sort column values in ascending/descending order when user click on grid columns in maintain? i.e. I hava a read/write grid in my form with n number of column.I want user to provide facility so that when user clicks on any column heading, the values get sorted in ascending/descending order.Please suggest a way to handle it.

Thanks in advance.
Anil Kumar

This message has been edited. Last edited by: Kerry,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
As far as I know, you can also specify the header of the grid to be clickable. In the maintain you then can find out if the header or the data is clicked. If header, re-sort the stack that holds the data by the column just clicked on (you can also find out which header column is clicked) and you're done.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Hi GamP,
I did not find any option to specify the header of the grid to be clickable.Can you please send me sample or any reference to handle this ? That will be really helpful.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
This is the easiest way of doing this with the grid in 7.6. There are three events that you can pick from:
OnTHRClicked - Top Header Right Clicked
OnTHLClicked - Top Header Left Clicked
OnTHRDlicked - Top Header Double Clicked

Those procedures pass the column back to the case. Start in column 0 and create a sort command for each column. You can even create an up/down flag to sort or sort by highest.

Case OnGrid1_OnTHRClicked Takes col / I12, row / I12, updn / I1, processed / I1;
if col=0 then stack sort stk by moviecode;
if col=1 then stack sort stk by title;
if col=2 then stack sort stk by category;
EndCase


Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
I'm pretty sure the first column is listed as column 1.

Fair warning -- the column number isn't returned unless the user clicks on the text in the title. The trigger can fire without the column and row parameters being populated. You need to trap for a col value of zero in your case, and exit out of the js if it doesn't have a value greater than zero.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Guru
posted Hide Post
hi Mark,
How can i create up/down flag to sort or sort by highest for every column?Please provide guidance.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Guru
posted Hide Post
hi Mark,
Please provide your guidance.

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Master
posted Hide Post
In my code I created Up1, Up2 and Up3 and set them all to blank. Now when the user clicks on the header, the sort is done and the Up variable toggles from blank to 1. Next time through it sorts the data in the other direction.

Mark

Case OnGrid1_OnTHRClicked Takes col / I12, row / I12, updn / I1, processed / I1;
compute xxx=col;
if col=0 and up1 ='' then begin
stack sort stk by moviecode;
compute up1='1';
endbegin
else
if col=0 and up1 ='1' then begin
stack sort stk by highest moviecode;
compute up1='';
endbegin
if col=1 and up2 ='' then begin
stack sort stk by title;
compute up2='1';
endbegin
else
if col=1 and up2 ='1' then begin
stack sort stk by highest title;
compute up2='';
endbegin
if col=2 and up3 ='' then begin
stack sort stk by category;
compute up3='1';
endbegin
else
if col=2 and up3 ='1' then begin
stack sort stk by highest category;
compute up3='';
endbegin
EndCase
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Guru
posted Hide Post
Thanks a lot Mark. It worked.

Regards.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Sorting option in Maintain Read/Write Grid

Copyright © 1996-2020 Information Builders