Closed mvladic closed 5 months ago
I would like to have a button to 'load column from data': If I specify a structure type variable in the data field pressing this button will disable auto column and defines all the columns based on the elements of the structure pointed to in the data field. This allows to quickly make an editor/display for existing data structures.
Manually performing this action is very cumbersome, also because I don't know how to display both the definition of the structure and the definition of the table column at the same time. So for each element I have to switch in UI.
The auto column mode doesn't resolve enumerations. It shows numbers.
Found a workaround: Set type to lookup and manually define what to display:
This doesn't work if the field is editable: During edit the field is a number again.
Using a array of struct (in screenshots: profiles is array of batteryProfile struct) as data input: If the struct contains a double the value displayed is incorrect, both when using plaintext and money (which appears to the number formatting type):
I think this is a very important use case.
The auto column mode doesn't resolve enumerations. It shows numbers.
Auto column is implemented by the Tabulator library. But, it makes sense if input data comes from array:struct:...
to override tabulator implementation since in this case Studio knows better.
The auto column mode doesn't resolve enumerations. It shows numbers.
Auto column is implemented by the Tabulator library. But, it makes sense if input data comes from
array:struct:...
to override tabulator implementation since in this case Studio knows better.
I agree but think the user knows even better but it is a lot of work to manually define all the columns that represent the struct elements. If there is a button that generates the column definitions with some sensible defaults, the users can easily customize the column afterwards. Pressing the button is a 1 time action.
Sure, both features should be added.
Using a array of struct (in screenshots: profiles is array of batteryProfile struct) as data input: If the struct contains a double the value displayed is incorrect, both when using plaintext and money (which appears to the number formatting type):
Juist noticed this problem is also present in the JSON Stringify action. So probably this is a more generic issue regarding internal struct -> json conversion:
Using a array of struct (in screenshots: profiles is array of batteryProfile struct) as data input: If the struct contains a double the value displayed is incorrect, both when using plaintext and money (which appears to the number formatting type):
Juist noticed this problem is also present in the JSON Stringify action. So probably this is a more generic issue regarding internal struct -> json conversion:
Did some more test. It appears only Double type is not working, other variable types work fine:
I found what is the problem with doubles in struct. It only appears when struct is defined through "Default value". If you make a struct with Flow.makeValue("struct:mystruct", { ... })
it will work fine. The root cause for the problem is that doubles are not 8 byte aligned. I will commit the fix soon.
Fix for doubles commited.
It works for all my use cases.
I added command "Build From Structure Definition":
Also, when "Auto columns" is enabled we will override auto columns feature from Tabulator in case when table data is of structure type and infer columns info from Structure definition.
For now, only Title and Field is inferred. In the future we will try to infer other Column properties, please be free to suggest it.
I forgot enum types, we should build formatter property from that.
This is how I'm now manually configured enum (still working out the exact settings for my case):
I think the generation/sync of the parameter list is important/convenient.
It doesn't sync for now. For sync we should have a new property:
Auto columns [ ]
Sync columns with structure definition: [x] ____my_struct [V]
This is required because if you build from structure and changed some column property you don't want sync to overwrite it. So you are all for sync or no sync.
Working on my example I'm hitting a limitation when working with selections. Selections are nice to allow for the deletion, duplication, etc of rows in my use case:
Please add 'row selected' and 'row deselected' events to the widget. The event should return the index number of the index of the row selected (not the displayed order but the index of the data array given to the tablulator). See https://tabulator.info/docs/6.2/events#select
These events will allow me to implement a 'delete row' , 'duplicate row' and a 'use row' functions.
I have added ON_ROW_SELECTED and ON_ROW_DESELECTED events. Both events outputs json value:
{
index: number, // 0-based index in table data
position: number // 1-based position in displayed rows
}
You will use .index
.
Also, columns properties for enum types are also generated:
But, this is still work in progress.
Fixed
Add new widget for tabular display of data from the database or imported files.
Table cells should be able to contain:
Enable:
Allow inserting table into instrument history.
More tasks: