Jquery spreadsheet

To develop a web-based spreadsheet using jQuery and Jspreadsheet, it is necessary to incorporate the following polyfill starting from version 10.






Source code

<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script src="https://jspreadsheet.com/v10/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v10/jspreadsheet.css" type="text/css" />
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<div id="spreadsheet"></div>

<br>

<input type="button" value="Add new row" onclick="$('#spreadsheet').jspreadsheet('insertRow')" />
<input type="button" value="Add new col" onclick="$('#spreadsheet').jspreadsheet('insertColumn')">

<script>
// Polyfill
(function($){
    $.fn.jspreadsheet = $.fn.jexcel = function(mixed) {
        var container = $(this).get(0);
        if (! container.jspreadsheet) {
            return jspreadsheet($(this).get(0), arguments[0]);
        } else {
            if (typeof(arguments[0]) == 'number') {
                var n = arguments[0];
                var i = 2;
            } else {
                var n = 0;
                var i = 1;
            }
            return container.jspreadsheet[n][mixed].apply(
                container.jspreadsheet[n],
                Array.prototype.slice.call(arguments, i)
            );
        }
    };
})(jQuery);


$('#spreadsheet').jspreadsheet({
    worksheets: [{
        minDimensions:[8,10],
    }],
    license: 'ZmI5M2E2ZDJiNzRhZmEyZDRlNjY0ODY5YWIwNTgxYmRjOTllOWZjMzc3YjU5NjgwNWRlYzI0NTc2OTJkYWJhYjFkOWE3NTA0YjhmMGIzNDEwNmMyNzc0M2NhNTFkMDA1ZWM4NTdhMmExNjVmNjA4OWQ3Y2I4OGFiYjEyMTRlYTIsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UY3dPVEkyTnpJNE5pd2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWQyVmlJaXdpYkc5allXeG9iM04wSWwwc0luQnNZVzRpT2lJek5DSXNJbk5qYjNCbElqcGJJblkzSWl3aWRqZ2lMQ0oyT1NJc0luWXhNQ0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklsMHNJbVJsYlc4aU9uUnlkV1Y5'
});
</script>
</html>