How to Delete undo and redo buttons from the spreadsheet

6 posts, 0 answers
  1. Saifulla
    Saifulla avatar
    15 posts
    Member since:
    Sep 2018

    Posted 01 Oct 2018 Link to this post

    I want to delete the controls(buttons like undo, redo, save,etc..) from the spreadsheet and want to add my own controls like textbox and some custom buttons. can some one suggest me how can I achieve this, I am using telerik for the first time.

    Thank You.

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1219 posts

    Posted 03 Oct 2018 Link to this post

    Hello Saifulla,

    You could define which buttons to be displayed on the Spreadsheet Home tab by configuring the toolbar.home option of the widget. As per the Undo and Redo buttons, which could not be removed by configuration, you could use the following CSS rules:
    .k-spreadsheet .k-tabstrip-wrapper .k-spreadsheet-quick-access-toolbar {
      display: none;
    }
     
    .k-tabstrip-top.k-spreadsheet-tabstrip .k-tabstrip-items {
      padding-left: 5px !important;
    }

    Here you could find a small Dojo sample implementing the above.

    As per adding your own controls to the Spreadsheet toolbar, here is how that could be done. Basically you will need to add a custom Tool to the list of tools.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Saifulla
    Saifulla avatar
    15 posts
    Member since:
    Sep 2018

    Posted 03 Oct 2018 in reply to Veselin Tsvetanov Link to this post

    Thanks for the answer sir, one more question actually i am creating my own custom buttons , and adding some java script functions. On clicking the button i want to call those functions. Is it possible?

     

  4. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1219 posts

    Posted 03 Oct 2018 Link to this post

    Hello Saifulla,

    Yes, the following Dojo demonstrates how to attach a click handler to a custom Spreadsheet toolbar button:
    $("#spreadsheet").kendoSpreadsheet({
      toolbar: {
        home: [
          ["bold", "italic"],
          "format",
          {
            type: "button",
            text: "Custom",
            spriteCssClass: "k-icon k-font-icon k-i-cog",
            click: function() {
              window.alert("custom tool");
            }
          }
        ]
      }
    });

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Saifulla
    Saifulla avatar
    15 posts
    Member since:
    Sep 2018

    Posted 04 Oct 2018 in reply to Veselin Tsvetanov Link to this post

    Thanks for the replay sir, one last question I am trying to create a dynamic html table generator. For that i need all cells to be deleted so i can create dynamic table based on user input. How can i do this??

     

    Thanks a lot sir.

  6. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1219 posts

    Posted 08 Oct 2018 Link to this post

    Hi Saifulla,

    I am not quite sure that I fully understand what exactly is the required scenario. If you would like to create a Spreadsheet with no cells initially loaded on the page and dynamically define the number of rows and columns, that would not possible. You will need to initialize a new widget with the proper rows and columns options set.

    If the above is not the case in question, I would like to ask you to explain a bit in detail what would you like to achieve.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top