Jexcel - Conditional Dropdown (Key, value dropdown)

Dealing with custom conditional selectbox.

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/components/bossanova-ui/css/jquery.jexcel.css">
<script src="https://bossanova.uk/components/bossanova-ui/js/jquery.jexcel.js"></script>
<div id="my"></div>

CSS

body { background-color:#eee }

JavaScript

data = [
    [3, 'Cheese'],
    [1, 'Apples'],
    [2, 'Carrots'],
    [1, 'Oranges'],
];

dropdown = function(instance, cell, c, r, source) {
    var value = $('#my').jexcel('getValue', c-1 + '-' + r);

    if (value == 1) {
        return ['Apples','Bananas','Oranges'];
    } else if (value == 2) {
    		return ['Carrots'];
    } else {
        return source;
    }
}

$('#my').jexcel({
    data:data,
    colHeaders: ['Model','Color', 'Buy'],
    colWidths: [ 300, 80, 100 ],
    columns: [
        { type: 'dropdown', source:[
        		{'id':'1', 'name':'Fruits'},
        		{'id':'2', 'name':'Legumes'},
            {'id':'3', 'name':'General Food'},
        ] },
        { type: 'dropdown',
        		source:['Apples','Bananas','Carrots','Oranges','Cheese'],
            filter:dropdown
        },
        { type: 'checkbox' },
    ]
});