============
edit_options
============

.. js:attribute:: edit_options

**domain**: client 

**language**: javascript

**class** :doc:`Item class </refs/client/item_api>`

Description
===========

Use the ``edit_options`` attribute to specify parameters of the modal edit form.

``edit_options`` is an object that has the following attributes:

* ``width`` - the width of the modal form, the default value is 560 px,
* ``title`` - the title of the modal form, the default value is the value of a
  :doc:`item_caption </refs/client/abstr_item/at_item_caption>`
  attribute,
* ``fields`` - specify the list of field names that the
  :doc:`create_inputs <m_create_inputs>` 
  method will use, if ``fields`` attribute of its ``options`` parameter is not 
  specified, the default value is a list of field names set in the 
  :doc:`Edit Fields Dialog </admin/items/edit_fields_dialog>` in the
  Administrator 
* ``close_button`` - if true, the close button will be created in the upper-right 
  corner of the form, the default value is true,
* ``close_caption`` - if true and close_button is true, will display 'Close - [Esc]'
  near the button
* ``close_on_escape`` - if true, pressing on the Escape key will trigger the 
  :doc:`close_edit_form <m_close_edit_form>`
  method.
* ``close_focusout`` - if true, the 
  :doc:`close_edit_form <m_close_edit_form>` method will be called when a form 
  loses focus
* ``template_class`` - if specified, the div with this class will be searched in 
  the task 
  :doc:`templates </refs/client/task/at_templates>` 
  attribute and used as a form html template when creating a form
  

Example
=======

.. code-block:: js

    function on_edit_form_created(item) {
        item.edit_options.width = 800;
        item.edit_options.close_button = false;
        item.edit_options.close_on_escape = false;    
    }

See also
========

:doc:`Forms </programming/interface/forms>`

:doc:`create_edit_form <m_create_edit_form>`

:doc:`close_edit_form <m_close_edit_form>`

