=====
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 its dataset.
The clone item has its own cursor, so you can navigate it and the cursor 
position of the item doesn't change.

Set the ``keep_filtered`` parameter to true if you want the clone to have the same 
local filter as the item.

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>`