Hi, how to have sorted data into a grid (without using a custom section) ? Also, saw there is a "sort" method for Grid but did'nt manage to use it ...
Regards
Hi, how to have sorted data into a grid (without using a custom section) ? Also, saw there is a "sort" method for Grid but did'nt manage to use it ...
Regards
You could do something like this:
The Page has a Form Section with its height set just large enough to display its Custom Menu and all header buttons hidden. Below that is a Grid Section with its header hidden. This is it in Development View:
The Form Section Custom Menu switches the index tag order of the Customers table and refreshes the Grid, causing it to be sorted in the selected order. Here's the code:
Regards,
Yvonne
Many thanks, I'll inspire me from this example!
After realizing indexes were needed and disappeared at exit, i was able to sort columns in first grid, but as I was doing this for another grid in another page it fails ...
Wed Jun 5 16:47:46 2013
**** Lianja error ****
tag STATS_PROVINCE_PROVINCENAME
^
No table is in USE
This very table being used for this grid ...
Called from procedure - province_sort_customsectionmenu at line 5
list stats_province shows
Production DBX file: stats_province.dbx
Index TAG: STATS_PROVINCE_PROVINCENAME
Key: PROVINCENAME
Type: Character
Len: 58
Any way out?
Regards
Is that the currently selected table? In my sample I only have one table/cursor open, so I have not included any SELECT statements to select the correct cursor. With more than one table, save the currently selected cursor and reselect it after changing the index tag order.
Index tags are required for each of the sort orders here and can be created at the Console using the NoSQL INDEX command or the SQL CREATE INDEX command. Once created, index tags exist in the basename.dbx file, so should not need to be recreated. Let us know if you are having a problem with this.
Regards,
Yvonne
Hi Yvonne,
This is a clever idea, but I think its more intuitive to allow us to put the code in the grid column header. Maybe even in the current click event if the row number = -1 type of thing.
Herb
Hi Herb, please submit an ER for a HeaderClick delegate and I'll implement an inline delegate that switches the order. The only pre-requistite with all this is that indexes you create must be prefixed by the child key.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Hi, can't figure out to do that ... I have 2 tables in 2 different pages and 2 delegates to specify the order
proc page1_Sort_customsectionmenu()
set order tag T1_NAME
Lianja.getElementById("Page1.T1List").refresh()
endproc
proc Page2_Sort_customsectionmenu()
set order tag T2_NAME
Lianja.getElementById("Page2.T2List").refresh()
endproc
sort on 1st table is ok.
When sorting on 2nd table
**** Lianja error ****
tag T2_NAME
^
TAG not found
Called from procedure - page2_sort_customsectionmenu at line 4
Modified delegate for T2 with a use statement
proc Page2_Sort_customsectionmenu()
USE T2
set order tag T2_NAME
Lianja.getElementById("Page2.T2List").refresh()
endproc
error is now
**** Lianja error ****
T2
^
ALIAS name 'T2' already in use
Called from procedure - page2_sort_customsectionmenu at line 4
It is not apparently the way to "select the correct cursor" ...
Regards
Change
Use t2
To
Select t2
Thanks!
Bookmarks