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

Spreadsheet in Partial view not loading properly

4 Answers 186 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Rachael
Top achievements
Rank 1
Rachael asked on 18 Jul 2016, 08:04 PM

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

4 Answers, 1 is accepted

Sort by
0
Rachael
Top achievements
Rank 1
answered on 18 Jul 2016, 09:41 PM

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.

0
Rachael
Top achievements
Rank 1
answered on 19 Jul 2016, 04:06 PM

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

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

0
Sandeep
Top achievements
Rank 1
answered on 20 Jul 2018, 09:38 AM

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

0
Neli
Telerik team
answered on 24 Jul 2018, 07:23 AM
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.
Tags
Spreadsheet
Asked by
Rachael
Top achievements
Rank 1
Answers by
Rachael
Top achievements
Rank 1
Sandeep
Top achievements
Rank 1
Neli
Telerik team
Share this question
or