Spreadsheet in Partial view not loading properly

5 posts, 0 answers
  1. Rachael
    Rachael avatar
    5 posts
    Member since:
    Jan 2016

    Posted 18 Jul 2016 Link to this post

    hi there,

    So I need to display a spreadsheet in a kendo window, and am loading the windows content via a partial view. However whenever I add the spreadsheet to the partial view I get this error upon page load in kendo.all.js: Unable to get property '_grid' of undefined or null reference

    When I add the spreadsheet to a regular view it loads as expected. If it's in the partial view it has all the tabs at the top (Home, Insert and Data) and the header info, just no grid or any of the sheets defined. I attached a picture.

    I am using MVC with razor.

     

    Is there any fix for this or is it a known issue?

    Thanks,

    Rachael

  2. Rachael
    Rachael avatar
    5 posts
    Member since:
    Jan 2016

    Posted 18 Jul 2016 Link to this post

    I actually would like to post an update on this.

    I found that the spreadsheet loads just fine in the window as long as the window is not hidden on page load.

    Currently the spreadsheet does not render correctly unless it is visible on page load, regardless of if it is in the window or not. Is there a way around this or is this a bug?

    I'd really like to toggle the visibility of the spreadsheet as I will be using it for editing on this web page.

  3. Rachael
    Rachael avatar
    5 posts
    Member since:
    Jan 2016

    Posted 19 Jul 2016 Link to this post

    In case anyone stumbles upon this, this is how you refresh a spreadsheet if it was hidden.

    $("#spreadsheet").show();
    $("#spreadsheet").data("kendoSpreadsheet").refresh();

  4. Sandeep
    Sandeep avatar
    13 posts
    Member since:
    Aug 2013

    Posted 20 Jul 2018 Link to this post

    I still face the similar issue. I have a grid and spreadsheet control, by default the grid is shown and spreadsheet is hidden. On button click I am hiding the grid and showing spreadsheet with the similar data. But the data is not visible in spreadsheet. I need to manually resize the web page for the Spreadsheet to adjust the view and then data gets visible. Tried calling Refresh $("#spreadsheet").data("kendoSpreadsheet").refresh(); after spreadsheet is made visible but it didn't help.

    Any more clues?

    Thanks,

    Sandeep

  5. Neli
    Admin
    Neli avatar
    289 posts

    Posted 24 Jul 2018 Link to this post

    Hi Sandeep,

    I tried to replicate the described scenario. I have prepared a Dojo example where there is a Grid and a Spreadsheet. Initially the Grid is displayed and the Spreadsheet is hidden. On a button click the Grid becomes hidden and the Spreadsheet is displayed. The Spreadsheet is rendered correctly on my side by using the refresh() method (screencast).
    function switchWidgets(){
      
      if($("#grid").is(':visible')){
         
        $("#grid").hide();
        $("#spreadsheet").show()
        $("#spreadsheet").data('kendoSpreadsheet').refresh();
         
      }else{
         
        $("#grid").show();
        $("#spreadsheet").hide()
      }
    }

    Could you please modify the provided Dojo sample so the issue to be reproduced? This will help us to inspect it locally and advise you further. 

    Regards,
    Neli
    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