Suppose I have a document with multiple pages. Is it possible to link to a different page for navigational purposes? I’m not referring to “linking widgets” in a data sense, I’m referring to giving the user a way to navigate to another specific page. For example, if I use the Custom HTML widget and have a button, can I link to a page from that?
Related question: Are there plans for a simple button widget?
I will add to this answer later, but just so you know
Yup, you can make links to other pages AND to specific records in other pages.
And there is already a simple button widget. What you want to do with the button?
I think this is my confusion… I don’t see a Button widget (either built-in or in the default Custom list), although as I wrote this post I was not actively in a Grist document, so maybe the list of default Custom widgets is not up to date?
It’s Action Button widget
you tell what column in what table it should look for the code for what to do. In the screenshot case, I created a column called ActionButton
It can do very simple things or like in my case, do more complicated stuff. In my case, it checks all employees marked with the checkmark in one table and one by one replicate them in another table, thus linking them to a training session
actions =
existing_treinamentos_funcionarios = set(Func_x_Treinamento.lookupRecords(Treino=$id).Funcionario)
count = 0
for e in Funcionarios.all:
if e not in existing_treinamentos_funcionarios and e.Selecao:
actions.append([“AddRecord”, “Func_x_Treinamento”, None, {
“Treino”: $id,
“Funcionario”: e.id,
“Presenca”: None
}])
actions.append([“UpdateRecord”, “Funcionarios”, e.id, {“Selecao”:False}])
count += 1
if actions:
return {
“button”: “Gerar {} Registros”.format(count),
“description”: ‘Gerar registros de Treinamento’.format(count, $Titulo),
“actions”: actions
}
else:
return {
“button”: “Zero Registros”,
“description”: “Zero Registros”,
“actions”: actions
}
the most basic part of the button is just this
“button”: “Gerar {} Registros”.format(count),
“description”: ‘Gerar registros de Treinamento’.format(count, $Titulo),
“actions”: actions
in button, you have a text for the button
in description, a text to appear under the button
and in action you can have the action directly there.
as my code was quite complicated, I first have the action code and then the button action just calls back all that code
Beautiful, I’ll check it out.
By the way (for anyone from Grist reading this), mention of the Action Button widget is indeed missing from the Docs. Or is this a special add-on widget.