Plugins

It is possible to enhance or create new custom features on your Jexcel Spreadsheets using official, third-party, or creating your plugins. You can accelerate the learning curve and create plugins using the official template below. It is possible to change the toolbar, context menu, overwrite calculations, creating new features, and much more.

Basic plugin template

var newPlugin = (function() {
    // Plugin object
    var plugin = {};

    /**
     * Executed when the spreadsheet is created
     */
    plugin.init = function(el) {
        // It would be executed in the spreasheet initialization
    }

    /**
     * Jexcel events
     */
    plugin.onevent = function() {
        // It would be executed in every single event and can be used to customize actions
    }

    /**
     * Run on the context menu
     * @param instance Jexcel Spreadsheet Instance
     * @param x coordinates from the clicked cell
     * @param y coordinates from the clicked cell
     * @param e click object
     * @param items current items in the contextMenu
     */
    plugin.contextMenu = function(instance, x, y, e, items) {
        // Can be used to overwrite the contextMenu

        return items;
    }

    /**
     * Run on toolbar
     * @param instance Jexcel Spreadsheet Instance
     * @param items current items in the toolbar 
     */
    plugin.toolbar = function(instance, itens) {
        // Can be used to overwrite the toolbar

        return itens;
    }

    return plugin;
});

Loading a plugin

A plugin can be loaded to a spreadsheet using the following code.

<html>
<script src="https://jexcel.net/v7/jexcel.js"></script>
<script src="https://jexcel.net/v7/jsuites.js"></script>
<link rel="stylesheet" href="https://jexcel.net/v7/jexcel.css" type="text/css" />
<link rel="stylesheet" href="https://jexcel.net/v7/jsuites.css" type="text/css" />

<script src="https://yourcustompath.com/js/jexcel.your_plugin_name.js"></script>

<div id='spreadsheet'></div>

<script>
jexcel(document.getElementById('spreadsheet'), {
    minDimensions: [10, 10]
    plugins: [{ name:'Plugin Name', plugin: newPlugin }],
    license: true,
});
</script>
</html>

A plugin source code example

You can download the source code on our github page.


Publish your plugins

You can publish your plugins on the website. Those plugins can be free or paid, the price is defined by the author. If you would like to become an author, please get in touch with: contact@jexcel.net

Go to the Plugin Gallery