Open sailr7 opened 5 days ago
Maybe some kind of popup with default actions (e.g. deleting the linked document?), with JavaScript hooks to add more features like already done with frm.add_custom_button
. Adding a specific button could make the link more useful even if not read-only. Alternative: improve the link popup that already exists
Category: User Interface Improvement Feature Type: Enhancement Related Modules: Forms / Fields
Summary
Add a new
clickable
property to read-only fields, allowing them to trigger a pop-up dialog or custom JavaScript action when clicked. This feature would improve the ERPNext user interface by enabling read-only fields to serve as interactive elements that display additional information or trigger actions, enhancing flexibility without requiring custom workarounds.Background and Motivation
Currently, ERPNext read-only fields are non-interactive and cannot trigger additional actions. However, there are many scenarios where a read-only field could benefit from clickable functionality, such as displaying a pop-up with more detailed data (e.g., composition breakdowns, nested data) or allowing users to modify the underlying data directly.
This limitation is particularly impactful because ERPNext does not support child tables within child tables, which creates challenges for users who need to display or edit complex, nested data structures. For instance, an item might have associated properties like “Chemical Makeup” (e.g., Ethylene glycol: 80%, Ammonia: 20%) that logically belong in a table format. Adding this table within another child table is not possible in the current ERPNext framework.
By making read-only fields clickable, users can view or edit underlying table data through a pop-up, providing a practical and streamlined workaround for nested child table limitations. More generally, this feature would allow developers and users to enhance read-only fields without needing to add extra buttons or complex custom scripts, resulting in cleaner interfaces and a more flexible user experience.
Proposed Solution
clickable
Property. Add aclickable
property to read-only fields that, when enabled, will: a) change the cursor to a pointer on hover to indicate interactivity; and b) allow the field to trigger an event or pop-up when clicked.on_click
). Provide an event trigger,on_click
, that developers can use to define custom actions. This could be a JavaScript function or a standard hook, allowing for easy integration of various interactions, such as displaying a related table in a pop-up.Conclusion
This feature will improve ERPNext’s interactivity by making read-only fields more functional and versatile, particularly as a solution for nested data structures. This will significantly benefit users who work with summarized data and need quick, accessible ways to view or interact with additional details.