===================
create_detail_views
===================

.. js:function:: create_detail_views(container) 

**domain**: client 

**language**: javascript

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

Use ``create_detail_views`` to create view froms of the details of the item.
These details can be specified in the **Edit details** attribute of the
:doc:`Edit Form Dialog </admin/items/edit_form_dialog>` or
set in the ``edit_details`` attribute of the
:doc:`edit_options <at_edit_options>`. 

This method is usually used in the ``on_edit_form_created`` event handler.

The following parameters are passed to the method:

* ``container`` - a JQuery object that will contain view form of the details, if 
  there is no container, the method returns.

If there is more than one detail, the method creates view forms in tabs.

If details are not 
:doc:`active <at_active>`
, the method calls their 
:doc:`open <m_open>`
method.

Example
=======

.. code-block:: js

  function on_edit_form_created(item) {
      item.edit_form.find("#cancel-btn").on('click.task', function(e) { item.cancel_edit(e) });
      item.edit_form.find("#ok-btn").on('click.task', function() { item.apply_record() });
      
      if (!item.master && item.owner.on_edit_form_created) {
          item.owner.on_edit_form_created(item);
      }
  
      if (item.on_edit_form_created) {
          item.on_edit_form_created(item);
      }
          
      item.create_inputs(item.edit_form.find(".edit-body"));
      item.create_detail_views(item.edit_form.find(".edit-detail"));
  
      return true;
  }

