Disable icons in toolbar

4 posts, 0 answers
  1. Hema
    Hema avatar
    20 posts
    Member since:
    Jul 2015

    Posted 24 Feb Link to this post

    I would like to disable some icons like freeze panes, table icon, Data tab etc in the toolbar . How to do that in Kendo UI ? I only saw an option like toolbar : false for completely removing the toolbar ( not disabling some tabs and icons inside the toolbar )
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 26 Feb Link to this post

    Hi Hema,

    There is a gap in the documentation which we will try to fix as soon as possible.

    Here is a quick explanation how to customize the toolbar:

    $("#spreadsheet").kendoSpreadsheet({
      toolbar: {
        home: ["exportAs"], //define single tool
        insert: [[ "addRowBelow", "addRowAbove" ]], //define tool group
        data: false //disable tab
      }
    });


    In short if you want to remove a tool you have to list all the tools that should be visible.

    The full list of tools is:

    home: [
        "open",
        "exportAs",
        [ "cut", "copy", "paste" ],
        [ "bold", "italic", "underline" ],
        "backgroundColor", "textColor",
        "borders",
        "fontSize", "fontFamily",
        "alignment",
        "textWrap",
        [ "formatDecreaseDecimal", "formatIncreaseDecimal" ],
        "format",
        "merge",
        "freeze",
        "filter"
    ],
    insert: [
        [ "addColumnLeft", "addColumnRight", "addRowBelow", "addRowAbove" ],
        [ "deleteColumn", "deleteRow" ]
    ],
    data: [
        "sort",
        "filter",
        "validation"
    ]


    I hope the information will help.

    Regards,
    Alexander Valchev
    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
  4. Adel Chenni
    Adel Chenni avatar
    7 posts
    Member since:
    Jan 2010

    Posted 12 May in reply to Alexander Valchev Link to this post

    Any way to change it after the spreadsheet has been initialized?
  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 16 May Link to this post

    Hello Adel,

    There is no build-in way to modify the ToolBar configuration at runtime. One possible option is to use the setOptions method of the Spreadsheet to change the initial settings. This however will result in re-creating the widget with the new setting, hence rebinding the data, loosing the current state and etc.

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