clone

clone(keep_filtered)

domain: client

language: javascript

class Item class

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

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

See also

on_filter_record