javascript function overload in functional way?
<p>I'm using slick grid and I like to change behavior of editor. Instead of copy&amp;paste I tried to overload one of functions but it doesn't work. I cannot read loadvalue function.</p>

<p>loadValue is defined as (some code omitted)</p>

<pre><code>    IntegerCellEditor : function(args) {
        this.loadValue = function(item) {
            defaultValue = item[args.column.field];
            $input.val(defaultValue);
            $input[0].defaultValue = defaultValue;
            $input.select();
        };
    }
</code></pre>

<p>What I tried is </p>

<pre><code>    function tristateIntegerCellEditor(check_field) { 
        var f = IntegerCellEditor;
        var f_loadValue = f.loadValue;

        f.loadValue = function(item) {
            f_loadValue(item);

            if (check_field) {
                if (!item[check_field]) {
                    $select.disable();
                }
            }
        };

        return f;
    }
</code></pre>

<p>Is there any way to substitute my function?</p>
