Is it possible to save tableView “state” to the layout on layout save?
For example we would like to save the:
- columns sorted by
- “filter”
- colorised cells
- etc.?
Is it possible to save tableView “state” to the layout on layout save?
For example we would like to save the:
All of these are quite different:
We’ve just added these three events to let the developer control what is being saved as part of the layout, and intercept the application of the layout. Note that when handling the onViewLayoutGenerated and onViewLayoutApplying, it’s possible to change the layout by assigning the layout.viewState field.
// open a table, then do View | Layout | Clone to see what's happening
function info(action, layout) { grok.shell.info(`${action}: ${layout.viewState}`); }
grok.events.onViewLayoutGenerated.subscribe((layout) => info('generated', layout));
grok.events.onViewLayoutApplying.subscribe((layout) => info('applying', layout));
grok.events.onViewLayoutApplied.subscribe((layout) => info('applied', layout));
Next to come: a field for storing the additional (app-specific, etc) information.
Thanks for providing these events. Am I right we could use the property API to save arbitrary data to the a layout and use this information later, right?
In any case, what are the limitations of the property API? In the past I was running into some issues when I was trying to save non-string data to the property API?
Properties API currently supports only string data.
But you can save additional information to ViewLayout.userData field (serialized to string).
NOTE: This field can be renamed in the future, we will notify you.
Hi DG community,
I have an additional question about layout.
Recently we are making project template with layout. The project contains serveral tables such as CSV, excel file and they are connected by primaly key like a RDB.
My question is…
Can layout keep link information of template project? ( Or how to keep / save link information of tables and apply it to other data sources?)
Any commnets or suggestions are greatly appreciated.
Thanks,
Taka
HI,
Yes, table linking data is stored in the project, but not in layout information, but connected with project itself.
Hi @alex.paramonov,
Thank you for your prompt reply!
Are there any ways to apply not only layout but also link information of a template to several dataset?
Thanks,
Hi,
Unfortunately, no.
We are now working in Project Layout concept, that allows to join multiple tables layouts and save linking info.