Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Handle custom row sort on display array table  (Read 6553 times)
Alessandro (Efisio) R.
Posts: 42


« on: July 15, 2020, 12:33:27 pm »

Hi,

We used to have a network share with samba on linux servers, for managing some input/output files created and used by our genero programs.
Since the migration on the GAS, we had to re-think this functionality and we came up implementing a little windows like file manager.
We took inspiration from the fgl-file-browser demo shipped with the fgl setup. Screenshots attached.
We implemented most important feature like download, upload, create folder, rename and delete folders and files, but the "last modified" sort is still missing.
Also we would like to implement multi row selection for downloading files, and in the future drag and drop.

We would like to add sorting by "last modified" column without formatting the array field like yyyy/mm/dd because it wouldn't be clear to the user.
Since the display array dialog is not using paged mode because the directory content is loaded through java utilities, and the ONSORT block, in this mode, is only used to execute post-sort tasks, I can't actually handle myself the sort of the array.
I've read these topics:
http://4js.com/fjs_forum/index.php?topic=1289.0
http://4js.com/fjs_forum/index.php?topic=1298.0
I've also see this github example:
https://github.com/FourjsGenero/ex_browseviewsort
I tried the workaround described in this message http://4js.com/fjs_forum/index.php?topic=1298.msg4549#msg4549, but unfortunately when the ON SORT block is triggered, the actual program array programmatically sorted and the DISPLAY ARRAY re-executed, the client keeps track of the column sort so the program array is re-sorted graphically by the selected column.
Furthermore, I think the paged mode/ON FILL BUFFER doesn't fit well with multi row selection.

Any advice?

Thanks
Efisio


* windows_file_manager.png (74.66 KB, 976x618 - viewed 1532 times.)

* genero_file_manager.png (83.13 KB, 1246x740 - viewed 1537 times.)
Rene S.
Four Js
Posts: 111


« Reply #1 on: July 17, 2020, 03:43:51 pm »

Hello Efisio,

1st answer:

you're asking for a FORMAT attribute for form fields with the type DATETIME. The runtime always sorts according to the type.

An example for numbers: 10 > 9, unlike "10" < "9".
An example for dates: 01/01/2010 > 02/03/2009, unlike "01/01/2010" < "02/03/2009".riab

Unfortunately: datetime variables/form-fields do not support a format attribute.

A fix should be possible.

2nd answer:
Simply use in the 4gl program the type DATETIME, use in the per file the widget type DATETIMEEDIT.
Works as expected: the variable is formatted as expected, the sorting respects the type.

Rene 


Alessandro (Efisio) R.
Posts: 42


« Reply #2 on: July 20, 2020, 09:45:57 am »

Hi Rene,

I tried the second solution you suggested, but the datetimeedit value format is like 20/07/2020 09:42 AM.
Since I don't want the AM/PM suffix, how can I remove it?

Thanks
Efisio
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines