- Home
- Forum
- ASP.NET MVC (Classic)
- Loading Grid through an ajax request after inital page load.
Loading Grid through an ajax request after inital page load.
1. I load up an initial page that contains no syncfusion elements in it. It seems like when if I call @{Html.Syncfusion().ScriptManager().Render();} on that initial page load, it doesn't really load anything because I haven't used any components at that point.
2. I have a link on the page that will dynamically load another view with a Syncfusion Grid built in. Since that grid was not in the initial page load, it seems I am missing several javascript elements to render it.
So my question is: Is there a way to dynamically load all of the elements I need for that grid either
- When I load the second page via AJAX with the grid on it (preferable, since a user might only load this page 10% of the time)
- When I load the initial page that doesn't have Syncfusion components on it.
I am using jQuery Mobile for the switching between pages, even though this is primarily a desktop application.
Thanks so much for any info you can provide!
- Chris
Hi Chris,
Thank you for using Syncfusion products.
Query : Loading grid through ajax request after page load?’
To achieve your requirement we suggest you to use $.ajax to load the grid after page load. While using Ajax post scripts will not be evaluated. To overcome this use $.fn.sfEvalScripts(data) function in success action. Please refer below code snippet for further details.
<script type="text/javascript">
$.ajax({
type: "GET",
url: "ServerMode",
data: "",
datatype: "html",
success: function (data) {
$("#Target")[0].innerHTML = data;
$.fn.sfEvalScripts(data);
}
});
</script>
For your convenience we have prepared a sample for the above scenario and it is attached below. Please refer to it.
Please let us know if you have any concerns.
Rakesh D
AjaxLoad_791687aa.zip
Hi John,
We regret for the inconvenience caused.
Could you please provide us the
Essential Studio Version you using at your end ? So that we can modify the sample and provide it in the Essential Studio Version you are using.
Please refer below our online documentation for “How to avoid Grid Invisibility”.
Please let us know if you have any concerns.
Regards,
Rakesh D
Hi John,
We are sorry for the inconvenience caused.
Please refer the below link instead of our previous update.
http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/howtoavoidgridinvisi.htm
Please let us know if you need any further assistance.
Regards,
Ajith R
- 5 Replies
- 4 Participants
-
CN Chris Neville
- Feb 22, 2013 06:04 PM UTC
- Sep 27, 2013 05:25 AM UTC