GridActionButton has been replaced with a single dict, for example:
GridActionButton(
url=URL("somewhere",
row.id),
text=f"click me",
icon="fa-redo",
message=f"are you sure?",
append_id=True,
)
with
{
"text": f"click me",
"url": URL("somewhere",
row.id),
"icon": "fa-redo",
"_tooltop": "will do something",
"_onclick": "confirm('are you sure?')",
)
Only text and url are required.
Using _ you can add any attribute you want to the generated button.
You can add htmx attributes as well.
{
"text": f"click me",
"url": URL("somewhere",
row.id),
"_hx-confirm": "are you sure?",
}
Also notice that I recommend adding hx-boost="true" to the div wrapping the grid load
<div id="htmx-target" hx-boost="true" hx-target="#htmx-target">
<div hx-get="[[=URL('my-grid-page')) ]]" hx-trigger="load">
Loading ....
</div>
</div>
I have not tried building much with htmx but what I tried worked.
My belief is that py4web should be transparent to HTMX and that is what I tried to achieve.
We do not want to break things because py4web or htmx change and are coupled.
I think as long as you have a way to pass any attribute you want using dicts you should be fine.