Can I disabled the cell when I load from JSON?

2 posts, 0 answers
  1. 東祐
    東祐 avatar
    1 posts
    Member since:
    Jan 2018

    Posted 02 Feb 2018 Link to this post

    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.

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2058 posts

    Posted 05 Feb 2018 Link to this post

    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.
Back to Top