=====
clone
=====

.. js:function:: clone(keep_filtered)

**domain**: client 

**language**: javascript

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

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

Use the clone method to create a copy of an item that shares with it the dataset.
The clone item has its own cursor, so you can navigate it and the item item 
cursor position doesn't change.

Set the keep_filtered parameter to true if you want to have it the same local
filter.

Example
=======

.. code-block:: js

    function calc_sum(item) {
        var clone = item.clone(),
            result = 0;
        clone.each(function(c) {
            result += c.sum.value;
        })
        return result;
    }

See also
========

:doc:`on_filter_record <on_filter_record>`