cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting on igrid tables

Former Member
0 Kudos

I am using MII workbench and I have generated an iGrid table in an applet on the frontend of my application which i am developing.

I wanted to sort it based on some coloumn number. Is there any way i can do it by some inbuilt igrid properties?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ashu,

you can select your coloumn header (which you want to sort) then hold control key and click Left mouse button on header.

Regards,

Manoj Bilthare

Former Member
0 Kudos

Ashu,

You can use Manoj's approach only in MII 12.1+ and it only sorts one column at a time. If you are using 12.0, you will need to do the sorting at the query template level. For a more dynamic approach, you can pass in a "sort by" parameter from the web page via JavaScript to the underlying query (via a parameter in the SQL statement).

Regards,

Kevin

Former Member
0 Kudos

hi Manoj,

I think kevin is right, Because i dont see it working on my version which is 12.1 . Although i see the coloumn header being followed by a up or down sign when i click the way you told me but then it does not sort them even after refrest or before that.

Hi Kevin,

Yeah you are right that i wanted to use a dynamic approach. what i understand from your anwer is I will have to pass some kind of sort by parameter to the query template via java script dynamically.

But then what is your idea of getting the event from the present page for knowing what sort I want at that time?

Former Member
0 Kudos

Hi Ashu,

You can use transformation GenericSortFilter.xsl for query and pass your valuesfrom JS.

OR you can use transaction with generic sort filter where you can dynamically pass values.

Regards,

Manoj Bilthare

Former Member
0 Kudos

Ashu,

you can use the [ColumnSelectionEvent|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm] of the iGrid and the iGrid method [getSelectedColumnName|http://help.sap.com/saphelp_mii121/helpdata/EN/44/d1e7a599f3409fe10000000a11466f/frameset.htm]. Use this to call a JS function that either calls a transaction that use the sort like Manoj suggested, or fill the [query parameter SortExpr|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm] and refresh the query result directly in your page.

Michael

Former Member
0 Kudos

Ashu,

12.1 and 12.2 have the sorting feature at runtime built in. The sorting (asc, desc) and the column sorted is not saved. That is why the arrows and sorting go away when you load or refresh the page.

As for the dynamic aspect of it, Manoj and Mike's approaches would work. Along those lines, I have seen a customer use Param.1 in a SQL query statement. Param.1 was set to -- so the line following it (order by) was commented out on applet load. Once the user would select some checkboxes, the Param.1 was changed and passed to the query and the applet was reloaded.

Cheers,

Kevin

Answers (0)