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: Horizontal Display Array / Scrollgrid  (Read 7693 times)
Simon B.
Posts: 2


« on: August 05, 2016, 01:15:36 pm »

Hi everyone,

Need some advise please on how to do something, or if its not possible can it potentially be added to the list of new features in future versions...

What I ideally want to do is have a display array (or Scrollgrid) that scrolls left to right rather than up and down, and dynamically create new columns based on the number of records in a database table, rather than rows
For example I always want 6 fixed rows vertically to match 6 fields in the dB table but for each record in the table I would like another column of 6 rows added horizontally to the array. I know dynamically adding the columns can be achieved in the form by using the om dom methods but it doesn't really help if you can't get the DYNAMIC ARRAY OF RECORD in the program code to display in this way. Otherwise is there perhaps a way of rotating the whole table container anticlockwise, but then my text would be vertical.

I'm fully aware of that I could display the exact same data in the normal way and just add a row for every dB record but it just looks wrong for the context of data I'm displaying.

So has anybody ever attempted something along these lines and if so do they have any advice in what route to take? Or is there another option I could use that I haven't thought of. We're currently using Genero 2.50.

Thanks in advance,

Simon
Reuben B.
Four Js
Posts: 1126


« Reply #1 on: August 06, 2016, 02:57:35 am »

There isn't a DISPLAY ARRAY ... ATTRIBUTES(HORIZONTAL)... which I suspect is what you'd like.

I'll list three techniques which may help...

In this example, https://github.com/FourjsGenero/wc_2darray, I use Web Components to render a 2d array.  That is display an array with a variable number of rows and variable number of columns, and the user can click on a cell which is passed back to the 4gl as an action.  It also has the ability to style individual cells and merge adjacent cells together.  The idea as with most of my web component examples is to hide the complexity of the web component from the 4gl developer and use 4gl calls to define and call.   It is using one of the new web component front-calls available in 3.0.  If you wanted to modify for 2.50, it would be a case of using onData or onProperty to pass the array definition into the web component.

In this example https://github.com/FourjsGenero/ex_dynamicinput I put up last week, it uses the new dynamic dialog calls in 3.0 to create a form and generate a INPUT dialog for a number of fields arranged in a variable number of rows, columns, and pages.

The third option which I don't have an example for and I haven't tried, but if you are using the web client, you maybe able to customize the table rendering so it goes across rather than down.  It might even be as simple as a CSS transform.

Hope that helps,

Reuben





Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines