This is a migrated thread and some comments may be shown as answers.
How to Delete undo and redo buttons from the spreadsheet
5 Answers 19 Views
This is a migrated thread and some comments may be shown as answers.
Saifulla
Top achievements
Rank 1
Saifulla asked on 01 Oct 2018, 07:48 AM

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.

5 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 03 Oct 2018, 07:30 AM
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.
0
Saifulla
Top achievements
Rank 1
answered on 03 Oct 2018, 07:47 AM

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?

 

0
Veselin Tsvetanov
Telerik team
answered on 03 Oct 2018, 01:52 PM
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.
0
Saifulla
Top achievements
Rank 1
answered on 04 Oct 2018, 01:54 PM

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.

0
Veselin Tsvetanov
Telerik team
answered on 08 Oct 2018, 11:58 AM
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.
Asked by
Saifulla
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Saifulla
Top achievements
Rank 1
Share this question
or