Load Components on button press.

Hi, I want to increase my page load time so is there any way to load sync fusion component(Accordion, Dropdowntree, Menu etc) like on button press or after the page has loaded. 

1 Reply 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team June 8, 2020 11:10 AM UTC

Hi Naresh Bisht, 

Greetings from Syncfusion Support. 

We have validated your requirement at our side and prepared a project based on that using the below code snippet. 

<!-- Add the HTML <div> element  --> 
<div id="element"></div> 
 
<script type="text/javascript"> 
    document.getElementById('btn1').onclick = function () { 
        var accordion = new ej.navigations.Accordion({ 
            items: [ 
                { header: 'ASP.NET', expanded: 'true', content: 'Microsoft ASP.NET is a set of technologies in the Microsoft .NET Framework for building Web applications and XML Web services.' }, 
                { header: 'ASP.NET MVC', content: 'The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller.' }, 
                { header: 'JavaScript', content: 'JavaScript (JS) is an interpreted computer programming language. It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed.' }, 
            ] 
        }); 
        //Render initialized Accordion component 
        accordion.appendTo('#element'); 
        document.getElementById('btn1').setAttribute('disabled', 'true'); 
    }; 
</script> 


Kindly try the above project and let us know if you need further assistance on this. 

Regards, 
Balasubramanian S

Marked as answer
Loader.
Up arrow icon