=============
edit_record
=============

.. js:function:: edit_record(container) 

**domain**: client 

**language**: javascript

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

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

Puts the current record in edit state and creates an 
:doc:`edit_form <at_edit_form>`
for visuall editing of the record.

If ``container`` parameter (Jquery object of the DOM element) is specified the
edit form html template is inserted in the container.

The ``edit_record`` method 

* calls the 
  :doc:`can_edit <m_can_edit>`
  method to check whether a user have a right to edit a record, and if not,
  returns
  
* checks whether the item is in edit or insert
  :doc:`state <at_item_state>`
  , and if not, calls the 
  :doc:`edit <m_edit>`
  method to edit a record
  
* calls the
  :doc:`create_edit_form <m_create_edit_form>`
  method to create a form for visuall editing of the record

See also
========

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

:doc:`Modifying datasets </programming/data/modifying_datasets>`

:doc:`edit <m_edit>`

:doc:`can_create <m_can_create>`
