Add toolbar (enable/disable) commands

2 posts, 0 answers
  1. Jack
    Jack avatar
    100 posts
    Member since:
    Jan 2007

    Posted 03 Jun Link to this post

    Is there a way to add commands to the SpreadSheet toolbar?

    I am especially thinking about the enable/disable range button.

    In a template/document scenario, one would want:

    - to build templates where some cell ranges have to be disabled;

    - to make documents based on such templates where disabled ranges (possibly including formulas) cannot be changed.

    In case this is an oversight (enable/disable seems to be the only range property that cannot be set via the toolbar), please log a defect for a fix in a future version.

     

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 Jun Link to this post

    Hello Jack,

    You can use the following code to add a custom tool to the toolbar:

        toolbar: {
            home: kendo.spreadsheet.ToolBar.fn.options.tools["home"].concat([
                {
                    type: "button",
                    text: "Foo",
                    spriteCssClass: "k-icon k-font-icon k-i-cog",
                    click: function(e) {
                        window.alert("custom tool");
                    }
                }
            ])
        }

    This reuses the currently defined tools in the "Home" toolbar, and adds a custom button, via the Toolbar item configuration.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top