Remove a field from the form display.
Please note - this property requires the Editor extension for DataTables.
The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only. If you already have an Editor license please sign-in, alternatively an Editor license can be purchased on this site, or sign up for the free trial.
This method provides the ability to hide a field from the end user at any time. This can be useful for cases when you want to have extra form fields available, but only show them under certain conditions (for example when a particular value is selected, you might provide further options based on that value). Fields which will never be visible to the end user can use the
hidden field type.
When a field is hidden, it is still part of the form and will be submitted with the other fields to the server, when the form is submitted, but it simply won't be visible to the user. The
clear() method is used to completely remove fields if required.
This is the inverse of the
Note that the
hide() method also provides the ability to remove a specific field from the form display, and also extends that ability to being able to remove multiple fields with a single call. For single fields, these two methods can often be used interchangeably. The key difference is in the return value - this method will return a
DataTables.Editor.Field instance, while the
hide() method returns a
DataTables.Editor instance. This can effect how you chain methods if you are using the returned value for chaining.