There are some situations were it may be advantageous to disable/enable groups or fields on all occasions. This may particularly be the case if you wish to disable a parent group, but still require nested groups or fields to be enabled.
The simplest approach is to use simple xpath functions in the Data Bindings tab to define the state required:
The same approach can be applied to the "hide" options.
The simplest approach is to use simple xpath functions in the Data Bindings tab to define the state required:
- To always "disable" a field you can define a binding of: true()
[/*][*] To always ensure the field is not "disabled" you can define a
binding of: false() [/*]
The same approach can be applied to the "hide" options.
RE: How do I always disable or show/hide groups or fields?
Hello Hyfinity Moderator
When this feature is used on an editable table: the 'edit' and 'delete' links are still active. The fields are not editable since they are disabled, but they can still be deleted. Can the 'edit' and 'delete' links be disabled along with the table when using that feature?
RE: How do I always disable or show/hide groups or fields?
The editable table provides a couple of options in the 'table_init' custom field that allow you to control whether the edit and delete buttons are present or not.
For more details please see http://www.hyfinity.com/node/44
RE: How do I always disable or show/hide groups or fields?
RE: How do I always disable or show/hide groups or fields?
RE: How do I always disable or show/hide groups or fields?
Sorry about the slow reply to your post. Unfortunately it sometimes takes a bit longer for someone's first post to get approved.
When using the editable table you do need to use the options listed in the other forum post to control what capabilities are enabled.
As you want this to be based on the activity name, I would first make sure that you have a hidden field on your page containing this value so that you are able to refer to it.
Next setup a custom script file on your page (if you don+?+?+?t already have one) and add a function to it like below:
function isTableEnabled(tableId, rowId) { if (hyf.util.getFieldValue('activity hidden field name') == 'DisabledActivity') //should be disabled return false; else return true; }
You will need to adjust the name of the hidden field, and the activity you are checking for as required, but hopefully this shows the approach.
The final step is to adjust the table_init fragment for the editable table. Change the allow_add, allow_delete, and allow_edit parameters so that rather then being set to true, they instead reference this new function, eg
hyf.editabletable.init(hyf.editabletable.getLastTableOutput(), {validate:true, allow_add: isTableEnabled, allow_delete: isTableEnabled, allow_edit: isTableEnabled });
I hope this helps illustrate the approach you need to take to conditionally disable the editable table functionality.
Please let me know if you have any further questions.
Regards,
Gerard