Add a custom action within a RecordDialog

22 views
Skip to first unread message

Francisco Martinez

unread,
Jan 7, 2022, 9:54:06 AM1/7/22
to Xataface
Hi

I am using the Calendar module to view the appointments for a clinic. 

When the module opens a RecordDialog form to edit an existing event (i.e. appointment) I would like to add a custom action (i.e. button) at the end of the RecordDialog form to open up a form to consult patient history for the shown appointment.

I tried adding an action to the table's actions.ini. 

The new action in the actions.ini  shows in the regular window, but I cannot make it to appear in the RecordDialog form that the calendar action opens when editing an event, I think the action is there but it is hidden in the header (which seems to be hidden by default by the recorddialog form).

I only get the SAVE button at the end of the form.  Anybody knows any way to add an additional button?

Thank you

Francisco

Steve Hannah

unread,
Jan 7, 2022, 10:04:10 AM1/7/22
to xata...@googlegroups.com
I'd like to add easier support for adding additional "submit" buttons on forms via actions, but haven't had a chance to do this yet.

In the meantime the easiest thing might be to attach your action to a particular field on the form using the fields.ini "actions" directive, which maps to a category in your actions.ini file.

E.g.

fields.ini:

[myfield]
   actions=myfieldactions

actions.ini

[myaction]
    category=myfieldactions
    ...


The key is that the value of the "actions" directive of the fields.ini file corresponds to the "category" directive in the actions.ini file.

This will render the "myaction" action as a button just below the "myfield" field.

Steve


--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/b06cd5de-249c-4143-aa49-582321b6f160n%40googlegroups.com.


--
Steve Hannah
Web Lite Solutions Corp.

Francisco Martinez

unread,
Jan 7, 2022, 10:33:15 AM1/7/22
to Xataface
Fantastic solution thank you Steve, this works as I need.

One small thing, I read in another post the question if the url for the action can be triggered in a new tab of the browser, I did not find if this is possible

currently the URL in my action looks like below and it opens in the same RecordDialog window with limited actions
url="{$this->url('-action=list&-table=Treatments&-sort=TreatmentID+desc&-cursor=0&-skip=0&-limit=30&-edit=1&-mode=find&-edit=1&PatientID=' . $record->getValueAsString('PatientID'))}"

If not possible I will redesign the destination URL to work well within the RecordDialog, you have already helped a lot.

Thanks for such a wonderful tool and gift to us.

Francisco  

Steve Hannah

unread,
Jan 7, 2022, 10:46:04 AM1/7/22
to xata...@googlegroups.com
You should be able to do target="_blank" in the action definition to have it open in a new window.

Reply all
Reply to author
Forward
0 new messages