Needs review
Project:
Editable Fields
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2012 at 01:16 UTC
Updated:
20 Feb 2019 at 14:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kingdee40 commentedAdded cancel button via javascript.
Comment #2
rosemberg commentedkingdee40, thank you so much!
Worked fine here. Just needed a little customization to be more close to my needs (cancel button appearing only in editing state) but I think the patch you've posted will help a lot the major use cases.
Comment #2.0
rosemberg commentedtypo
Comment #3
romaingar commentedHello just in case you would like to perform a cancel button without reload the page as the solution #1
Comment #4
sistro commentedVery useful... but the patch fails with latest dev version.
Romaingar solution is for a custom module, right?
Comment #5
Gunfigter100 commentedRomaingar's answer proved very helpful. Two notes about it though. The variable $display is not set anywhere in the provided code. It appears to be a reference to the $display argument in editablefields_form() which is then hooked by this function. I accessed this variable in my hook_form_alter() function by setting $display = $form_state['build_info']['args'][5] as this appears to hold the values sent to the originating function. Secondly, there is no #value attribute set in the $form['actions']['cancel'] array so the new button appeared as a blank button or as just a sliver of a button depending on the theme I was using.