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

Can I disabled the cell when I load from JSON?

1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
東祐
Top achievements
Rank 1
東祐 asked on 02 Feb 2018, 09:35 AM

Hello,

 

I'm trying to disabled the cell after I loaded Data but I failed.

What should I do to achieve my need?

Some action I already tried below:

1.

$(function() {
    $("#spreadsheet").kendoSpreadsheet({
    });
    spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
     $.getJSON("<%=request.getContextPath()%>/data.json")
     .done(function (sheets) {
         spreadsheet.fromJSON( sheets);
     });
     var rangeChange = spreadsheet.activeSheet().range("A1:H9");
    rangeChange.enable(false);
});

2.

add the attribute : "enable" : "false" to JSON Data.

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 05 Feb 2018, 02:04 PM
Hello,

As mentioned in the documentation when the fromJSON method is called the existing sheet data and configuration (disabled cells for instance) is cleared. So try calling the method in the done() callback method after calling fromJSON:
.done(function (sheets) {
    spreadsheet.fromJSON(sheets);
    var rangeChange = spreadsheet.activeSheet().range("A1:H9");
    rangeChange.enable(false);
});

otherwise rangeChange.enable(false) will be called before the fromJSON method and this method will clear the disabled cells. 

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
東祐
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or