OK, by trial and error I’m now able to have a single grid app that dynamically loads data from different db tables\views.
[SIZE=16px]db[/SIZE]
I created a view named ‘dumb_table’ in the db (mariadb) so that the Grid app can be configured and generated on an existing table\fields. The idea is not to use any ‘real’ table\view in the grid app configuration, so that it will keep working even if any table\view is later deleted from the db.
The view is very simple: [INDENT]
select null AS `dumb_field1`, null AS `dumb_field2`
[/INDENT] Note: create as many fields as you need.
[SIZE=16px]grid app sql settings[/SIZE]
sql select statement: [INDENT]
SELECT dumb_field1, dumb_field2 FROM dumb_table
[/INDENT] table\fields variables: [INDENT] [ATTACH=CONFIG]n72876[/ATTACH]
[/INDENT] [SIZE=16px]usage[/SIZE]
To set which tables\fields are loaded by the grid, pass the following as parameters when the app is run: [INDENT][var_real_table] = ‘name_of_the_table_to_load’
[var_real_field1] = ‘name_of_1st_field’
[var_real_field2] = ‘name_of_2nd_field’[/INDENT]
