=========
view_form
=========

.. js:attribute:: view_form

**domain**: client  

**language**: javascript

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

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

Use ``view_form`` attribute to get access to a Jquery object representing the 
view form of the item. 

It is created by the 
:doc:`view <m_view>`
method.

The 
:doc:`close_view_form <m_close_view_form>`
method sets the ``view_form`` value to undefined.

Example
=======

In the following example the button defined in the item html template is assigned 
a click event:

.. code-block:: js

    item.view_form.find("#new-btn").on('click', 
        function() {
            item.insert_record();
        }
    );
    
See also
========

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

:doc:`view <m_view>`

:doc:`create_view_form <m_create_view_form>`

:doc:`close_view_form <m_close_view_form>`
    