Unable to refresh diagram in Partial view

Hi,

I am developing a project where we need to plot diagram based on selected item from a drop down. I have added the diagram in a partial view and triggered an ajax call to get diagram partial view. But the partial view returns empty div. I have attached a small demo where I tried to load a partial view on ajax call. Can you please help on this?


Attachment: SyncfusionDemo_b6d4f2a4.zip

8 Replies

AR Aravind Ravi Syncfusion Team February 17, 2022 08:38 AM UTC

Hi Purushothaman


We are validating and update you with more details on February 21st 2022.


Regards

Aravind Ravi





AM Arunkumar Manoharan Syncfusion Team February 22, 2022 07:11 PM UTC

Hi Purushothaman,


We are facing an issue while running your shared sample w
e will validate and update you with more details within two business days.


Regards,

Arun Kumar.



AM Arunkumar Manoharan Syncfusion Team February 23, 2022 01:27 PM UTC

Hi Purushothaman, 

We have modified the sample to render the diagram in partial view. To render the diagram, you need to set partialview in await so that the ajax call wont be return an empty div for diagram content. For more information, please refer to the sample link and code example below.
 
 
Code Snippet: 
<div id="main"> 
@await Html.PartialAsync("Diagram-Partial") 
 
</div> 
 
<div id="Diagram"> 
 
</div> 
 
 
 
Regards,
Arun Kumar.
 



PG Purushothaman Govindaraj March 3, 2022 02:56 AM UTC

I am not expecting this answer, what I am looking for is to refresh the diagram based on a event change for example refresh diagram on dropdown selection or button click. I have updated my solution and attached the latest solution. I have 2 partial and I want them the partial should be switched based on a button click. Please don't add the partials in the page and toggle hide/show in button click. I want the partial to be refreshed from the controller. Please check the latest attached solution.



AM Arunkumar Manoharan Syncfusion Team March 3, 2022 05:14 PM UTC

Hi Purushothaman,

Can you please reshare the file we couldn’t able to find any attached sample file?


Regards,

Arun Kumar.



PG Purushothaman Govindaraj March 4, 2022 03:45 AM UTC

Please find the solution attached


Attachment: SyncfusionDemoUpdated_7abceadc.zip


SG Shyam G Syncfusion Team March 7, 2022 09:33 PM UTC

Hi Purushothaman Govindaraj,

  We will validate and provide you with more details on 8th March, 2022.

  Regards,

  Shyam G



SG Shyam G Syncfusion Team March 8, 2022 08:41 PM UTC

Hi Purushothaman Govindaraj,


You should define ejs script tag in the partial view to achieve your requirement.


Code example:

Diagram-Refresh.cshtml

 

<ejs-scripts></ejs-scripts>



Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SyncfusionDemomodified666113074


Regards,

Shyam G


Loader.
Up arrow icon