contentTemplate

A template string or a JavaScript function to be used for rendering the content of each item in the accordion.

If a function is used, it will receive the following parameters:
- item - the dataSource item associated with this element
- index - the index of the dataSource item
- element - the element rendering the item

The widget will update the content element with the return value of the contentTemplate function. If nothing is returned, the element will not be updated.

<div id="accordion"></div>

<script type="text/javascript">
$(function () {
    $("#accordion").shieldAccordion({
        contentTemplate: function(item, index, element) {
            return "" + item.content + "";
        }
        dataSource: {
            data: [
                {
                    title: 'Perl',
                    content: 'A very good programming language'
                },
                {
                    title: 'C++',
                    content: 'Also very good for development'
                },
                {
                    title: 'JAVA',
                    content: 'Moderate stuff'
                }
            ]
        }
    });
});
</script>