This is a migrated thread and some comments may be shown as answers.

How to prevent user from inserting a new sheet or deleting an existing sheet

3 Answers 1609 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Sandra Walters
Top achievements
Rank 1
Sandra Walters asked on 25 Apr 2016, 07:07 PM

Is there a way to prevent the sheetsbar from displaying the Insert button, as well as a way to disable the user's ability to delete an existing sheet? 

I've tried some basic DOM manipulation (find the Insert element and remove it) but that appears to throw off the formatting of the sheetsbar somewhat.  Is there a recommended method to do either of these?

3 Answers, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 26 Apr 2016, 09:21 PM
Hello Sandra,

I have two options for you to take a look at.

1.  Hide the SheetsBar.

Please take a look at this Telerik Dojo illustrating how to hide the SheetsBar.  
Here's the code used in the example:
$("#spreadsheet").kendoSpreadsheet({
    sheetsbar: false,
    ...
});


2. Use jQuery and CSS to customize the Kendo Spreadsheet.

Here is an example using the Dojo illustrating one approach you can use to customize the tabs.

When the render event fires (which fires when the widget has completely rendered), I use jQuery to hide the insert and remove buttons.  I also use CSS to fix the formatting of the tabs.

Hope this helps!

Regards,
Patrick
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Sandra Walters
Top achievements
Rank 1
answered on 26 Apr 2016, 11:24 PM

Hi Patrick, thanks for the reply.

Hiding the sheetsbar makes it impossible for the user to navigate from one sheet to another; this really isn't a suitable solution.

I tried the second option you mentioned, which was similar to what I'd tried initially.  With the css theme I'm using (bootstrap) the tab's title is directly against the edge of the tab.  I solved this by adding the following:

.k-link {
    margin-right: 12px;
}

 

Thanks again!

0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 27 Apr 2016, 02:24 PM
Hi Sandra,

Glad everything worked out!  

Regards,
Patrick
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Spreadsheet
Asked by
Sandra Walters
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Sandra Walters
Top achievements
Rank 1
Share this question
or